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

For some reason my teleportation script stopped working, how can I fix it?

Asked by 5 years ago

I am trying to make a teleport block that takes the player across the map. It works when I'm in Roblox studio, but when I try to test it through the actually player, it doesn't work. I tried to fix it the same way other people have fixed it in the past. (put wait (1)) thing. I also made sure that the player actually does hit the block. here is the code, it is pretty simple, but I have never worked with LUA before (or any code) so I have no idea what I'm doing.

script.Parent.Touched:connect (function(hit)
    if hit.Parent:FindFirstChild('Humanoid')then
    hit.Parent.Torso.CFrame = CFrame.new(74.622, 29.835, -202.916)
    end
end)

It is probably either very simple or very dumb, but I hope I can get a fix to it.

0
it’s Lua not LUA User#19524 175 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

Try making a part in the workspace that its position is the teleportation position and changing the code to workspace.Part.CFrame

Ad
Log in to vote
0
Answered by 5 years ago

Seeing your ROBLOX avatar is R15, your game could be (I don’t know) as well. The R15 rig does not have a Torso. But both R6 and R15 have a part called HumanoidRootPart.

script.Parent.Touched:Connect(function(part)
    if part.Parent:FindFirstChild"Humanoid" then
        part.Parent.HumanoidRootPart.CFrame = CFrame.new(74.622, 29.835, -202.916)
    end
end)
0
Thank you! that fixed it. bestcaptainsparklez 0 — 5y

Answer this question