so ive got a teleport book in my game and i want to add a visual cooldown along with an actual one.
heres the script ive got
local reqLevel = 1 local player = game.Players.LocalPlayer script.Parent.MouseButton1Down:connect(function() if player.leaderstats.Lvl.Value >= reqLevel and player.Character then player.Character:MoveTo(Vector3.new(173.51, 385.797, 118.025)) end end)
i could just add
script.Parent.Visible = false wait(120) script.Parent.Visible = true
after the coords but im needing a visual timer and im lost with that, im assuming it would be done with a for
loop, but i dont know how to make it a visual count down on the book, any help to steer me in the right direction would be appreciated :P
for the visual countdown I would recommend a While Wait() do
loop, so just edit as follows
a = 0 -- Used to set a's first value Place_number_amount_here = 10 --Type amount of times you want loop to run here! --Two values not needed, just used to make it easier. num = Place_number_amount_here while wait() do a = a - 1 --subtracts 1 to a --Code goes here if a == num then --Get number break -- Stop loop if a == num. end end
Hope this helped