Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to teleport and close GUI at the same time?

Asked by
RBLXHS 9
3 years ago
Edited 3 years ago

Here is what I am working with. I am trying to combine these two scripts. It teleports, but it does not close the GUI after the teleport is complete.

wait(1)
player = game.Players.LocalPlayer
button = script.Parent
local debounce = false

function helpme()
 if not debounce then

 debounce = true
 LowerTorso = player.Character.LowerTorso
 LowerTorso.CFrame = game.Workspace.mainfloor.CFrame

 end
end
button.MouseButton1Click:connect(helpme)

while true do wait()
debounce = false
wait(7.5)
end

script.Parent.MouseButton1Click:connect(function()
    script.Parent.Parent.Parent:Destroy()
end)

1 answer

Log in to vote
0
Answered by 3 years ago
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
character:MoveTo()--Teleport player
script.Parent.Parent.Parent:Destroy()

just make it simply not difficult.

Ad

Answer this question