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

How to Teleport Player Back to Place?

Asked by
TofuBytes 500 Moderation Voter
10 years ago

I tried to teleport the player back to the other place, but it won't work. This is a local script located in the StarterGUI. Any help?

while true do
print("Sound is Playing")
script.Parent.Credit:Play()
wait(100)
script.Parent.Credit.Volume = 0.4
wait(0.5)
script.Parent.Credit.Volume = 0.3
wait(0.5)
script.Parent.Credit.Volume = 0.2
wait(0.5)
script.Parent.Credit.Volume = 0.1
wait(0.5)
script.Parent.Credit.Volume = 0
wait(5)
print("Did it Send You Back?")
game:Service("TeleportService"):Teleport(42860954)
wait(10)
script.Parent.Credit:Destroy()
wait(10)
end

1 answer

Log in to vote
1
Answered by
drahsid5 250 Moderation Voter
10 years ago

May I ask why this is in a loop?

--I'll assume this is in a GUI in starter GUI.
--Put this in a local script
local Player = game.Players.LocalPlayer
while true do
print("Sound is Playing")
script.Parent.Credit:Play()
wait(100)
for i=1,5 do --Use a For Do loop, to shorten the script, and save time while scripting.
script.Parent.Credit.Volume = (script.Parent.Credit.Volume - 0.1)
wait(0.5)
end
game:Service("TeleportService"):Teleport(42860954, Player) --It has to know WHO to teleport.
wait(10)
script.Parent.Credit:Destroy()
wait(10)
end

0
Thank you! TofuBytes 500 — 10y
0
No problem. drahsid5 250 — 10y
Ad

Answer this question