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

Why is my teleport pad not working properly?

Asked by
6zk8 95
4 years ago
script.Parent.Touched:Connect(function(part)
   local hum = part.Parent:FindFirstChild("HumanoidRootPart")
   hum.Position = game.Workspace:WaitForChild("Teleport2")
   wait(5)
end)

There are two problems with the script above. First,you teleport you teleport to where your meant to be but your body is halfway in the baseplate. I know why it's happening but I don't now how to fix it(it changes the hum position, which is the humanoid root part) to the ground. Secondly, the wait(5) dosen't work. All help would be appreciated!

1 answer

Log in to vote
1
Answered by
qVoided 221 Moderation Voter
4 years ago
Edited 4 years ago

It will glitch when you change the position, so use the CFrame instead. Also use debounce when delaying something.

Script:

local debounce = false

script.Parent.Touched:Connect(function(part)
    if not debounce then
        debounce = true
        if part.Parent:FindFirstChild("Humanoid") then
            local humRoot = part.Parent.HumanoidRootPart
            humRoot.CFrame = game.Workspace:WaitForChild("Teleport2").CFrame + Vector3.new(0,2,0)

        end

    end
    wait(5)
    debounce = false
end)
0
The debounce dosen't work and most of the script is wrong. 6zk8 95 — 4y
0
Excuse me? It worked in mine! qVoided 221 — 4y
0
I was just trying to help you, man, the script has nothing wrong.. qVoided 221 — 4y
0
Maybe I do it a different way from you, but that doesn't mean I'm wrong! qVoided 221 — 4y
0
Press "view source" then copy paste. qVoided 221 — 4y
Ad

Answer this question