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

This teleport script didn't work! What is wrong with it?

Asked by 10 years ago
function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        game.GetService("TeleportService"):Teleport(116211000, player)
    end
end

script.Parent.Touched:connect(onTouched)

Help!

1 answer

Log in to vote
0
Answered by
Damo999 182
10 years ago

You forgot your colon :

function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        game:GetService("TeleportService"):Teleport(116211000, player)-- on this line i fixed it
    end
end

script.Parent.Touched:connect(onTouched)
0
Oh, I'd completelly forgotten. StickMasterNinja2 0 — 10y
0
+1 me lol Damo999 182 — 10y
Ad

Answer this question