I tried making this script myself but, it won't work I was trying to do is a player can't spam the teleport back to the island. But, sadly I failed. So, here's the script if anyone could help me that'd be wonderful! :)
local db = true
local player = game.Players.LocalPlayer
local target = game.Workspace.TeleportPart
local delay = 3
script.Parent.MouseButton1Click:connect(function()
if db == true then
db = false
player.Character.HumanoidRootPart.CFrame = target.CFrame * CFrame.new(0, 3, 0)
for i = delay, 1, -1 do
script.Parent.Text = i
wait(4)
end
script.Parent.Text = "Teleport to Red Brick"
db = true
end
end)
local cooldown = 0.25

4 comments
this code inclues a debounce and will not be active until your for loop has completed. Are you sure it is not another script that is causing the problem.
No,
Can you take a screenshot/gif so we can see what this code is doing when it is ran.
One sec.