I know the title isnt worded the best but I shall elaborate here.
I have a teleport script, and the way you activate it is by clicking a GUI and I was wanting a cooldown between every click, lets say 5 seconds for example. I added a wait to the script but it doesnt do what id like. I am thinking I may have to turn it into in "if and" statement or a "repeat" statement but I dont know for sure.
Heres the script :) Thanks for your time
local plr = game.Players.LocalPlayer --This is the client
local char = plr.Character or plr.CharacterAdded:Wait() --This is the character
local root = char:WaitForChild("HumanoidRootPart") --This is the HumanoidRootPart
local teleportTo = workspace.FrontTeleport --This is where you teleport to!
local guiButton = script.Parent --This is the button you're clicking!
guiButton.MouseButton1Down:Connect(function() --MouseButton1Down event
root.CFrame = teleportTo.CFrame * CFrame.new(0,3,0) --Set the root's CFrame to the teleportobject's CFrame, translate it up by 3 studs
end)
