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

My teleportation pad just kills me?

Asked by 10 years ago

Well I haven't scripted in a while and I have no idea why this won't work and trust me going here is my last resort. I get no output and it kills me then the next time I respawn and hit the pad again it does nothing.

debounce = false

script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") then
    if debounce == true then return end
    debounce = true
    Char = hit.Parent
    Char.Torso.Position = (game.Workspace.tele.Position + CFrame.new(0,5,0))
    m = Instance.new("Message", Workspace)
    m.Text = "Teleported"
    wait(5)
    m:Destroy()
end
end)

1 answer

Log in to vote
2
Answered by 10 years ago

Lol, this kind of thing happened to me before while using 'Position', try using CFrame, or the ':MoveTo()' method for it;

Char.Torso.CFrame = CFrame.new(game.Workspace.tele.Position + Vector3.new(0, 5, 0))

Hope this helped! (If still having trouble just PM me and I'll take a look)

1
No way you're a genius, thanks! GetSporked 5 — 10y
0
Nah, not a genius, just any ordinary scripter. :P TheeDeathCaster 2368 — 10y
Ad

Answer this question