#While and UIS:IsKeyDown [Not Solved]
12 messages · Page 1 of 1 (latest)
like what 💀
local RS = game:GetService("ReplicatedStorage")
local Remotes = RS:WaitForChild("Remotes")
local Remote = Remotes:WaitForChild("FlashStep")
local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local MyKey = Enum.KeyCode.Q
local isKeyDown = false
UIS.InputBegan:Connect(function(key)
if key.KeyCode == MyKey then
isKeyDown = true
Remote:FireServer()
end
end)
UIS.InputEnded:Connect(function(key)
if key.KeyCode == MyKey then
isKeyDown = false
end
end)
local function updateWalkSpeed()
if isKeyDown then
hum.WalkSpeed = 50
else
hum.WalkSpeed = 16
end
end
game:GetService("RunService").Heartbeat:Connect(updateWalkSpeed)
try this
i wanted it to stop running after half a second then continue to run again
btw what is run service and .Heartbeat
heartbeat is a event that fires every frame like it runs once per frame
sounds useful
While and UIS:IsKeyDown [Not Solved]
how, like looping?