#how do i add a cooldown it says (cooldown) where i need it

16 messages · Page 1 of 1 (latest)

tranquil turret
#

script 1 :
local uis = game:GetService("UserInputService")
local event = game.ReplicatedStorage.RemoteEvent

uis.InputBegan:Connect(function(input, typing)
if input.KeyCode == Enum.KeyCode.LeftControl then
event:FireServer(0)
end
end)
uis.InputEnded:Connect(function(input, typing)
if input.KeyCode == Enum.KeyCode.LeftControl then
event:FireServer(1)
end
end)
uis.InputEnded:Connect(function(input, typing)
if input.KeyCode == Enum.KeyCode.Q then
event:FireServer(2)
(cooldown)
end
end)
script 2:
local event = game.ReplicatedStorage.RemoteEvent
event.OnServerEvent:Connect(function(player, sprint)
if sprint == 0 then
player.Character.Humanoid.WalkSpeed = 36
else if sprint == 1 then
player.Character.Humanoid.WalkSpeed = 16
else if sprint == 2 then
player.Character.Humanoid.WalkSpeed = 100 wait(0.3)player.Character.Humanoid.WalkSpeed = 16
end
end
end
end)

native juniper
#

use the format thing so like wrap your code with 3 ` on each end

#

Also look into debounces

tranquil turret
#

I changed code

#

local uis = game:GetService("UserInputService")

local Player = game.Players.localplayer
local Char = Player.character or Player.characteradded:wait()
local Humanoid:Humanoid = Char.waitforchild("humanoid")

uis.InputBegan:Connect(function(input, typing)
if input.KeyCode == Enum.KeyCode.LeftControl then
Humanoid.WalkSpeed = 36
end
end)
uis.InputEnded:Connect(function(input, typing)
if input.KeyCode == Enum.KeyCode.LeftControl then
Humanoid.WalkSpeed = 16
end
end)
uis.InputBegan:Connect(function(input, typing)
if input.KeyCode == Enum.KeyCode.Q then
Humanoid.WalkSpeed = 100 wait(0.3)player.Character.Humanoid.WalkSpeed = 16
end
end)

#

wont work

cobalt canopy
tranquil turret
#

@cobalt canopy

#

What dat do

cobalt canopy
tranquil turret
#

Whats format

#

@cobalt canopy

#

Im new

#

So isk

#

Idk