Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My script in TeleportService Won't work?

Hmm..... I want to make a Game (Not a place) with all places i have, but i can't. My code won't work, even that model can edit and got from a person. I tried all but.. won't work. Help me Guys What part of script is not working.

function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        game:GetService("TeleportService"):Teleport(127345959, player)
    end
end
 
script.Parent.Touched:connect(onTouched)

2 answers

✓ Accepted answer
function onTouched(hit)
while true do
local play = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
game:GetService("TeleportService"):Teleport(127345959,player)
end
end
script.Parent.Touched:connect(onTouched)

2 comments

0

Oh thanks :D

0

but... can u make it a model in models and give it to me? i cant read scripts, dont know what spacing. Please :D

This discussion is preserved as it was. New answers, comments, and votes are closed.