So earlier I made a ScreenGUI with a Text Button that would teleport to places around the map. Then I added an animation to it but the Teleport happens instantly without a delay so the animation has no time to play before the teleport. This is the script: wait(1) player = game.Players.LocalPlayer button = script.Parent local debounce = false
function helpme() if not debounce then
debounce = true
Head = player.Character.Head
Head.CFrame = game.Workspace.Gate1.CFrame
end
end button.MouseButton1Click:connect(helpme)
while true do wait() debounce = false end. I am Just asking for someone to help me learn how to add a delay to this.

4 comments
Doesn't teleporting the head kills the player? I thought only HumanoidRootPart could be CFramed to move the entire character. Also your debounce seems like it won't work, use (if debounce == false then) because i think (if not debounce then) will only work if debounce is nill i guess. also reset debounce to false at the end of the function.
For the delay simply put a wait after playing the animation and then cframe the player. Or connect a markerreachedsignal from that animation with the teleport.
No teleporting the head also teleports the entire body I just have the block it's teleporting to raised high enough to where it spawns the body on the floor.
@Dfozoz
notapplies to false AND nil conditions