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

Why won't this work?

Asked by 10 years ago
ID = 132286557

function Teleport(hit)
    game:GetSevice("TeleportService"):Teleport(ID, hit.Parent)
end

script.Parent.Touched:connect(Teleport)
0
I tried it in LocalScript. It didn't work. I tried it in Script, it didn't work. BosswalrusTheCoder 88 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago
local ID = 132286557
function Teleport(player)
    game:service("TeleportService"):Teleport(ID, player)
end

script.Parent.Touched:connect(function(hit)
    find = hit.Parent:FindFirstChild("Humanoid")
    if find then
        plr = game.Players:GetPlayerFromCharacter(hit.Parent)
        if plr then
            Teleport(plr)
        end
    end
end)

-- I rushed that code, let me know if it works. (It should work fine though)
0
IT worked. BosswalrusTheCoder 88 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

You spelled GetService wrong, you forgot the R.

Answer this question