Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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.

1 comment

0

it’s Lua not LUA

2 answers

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

###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)

1 comment

0

Thank you! that fixed it.

This discussion is preserved as it was. New answers, comments, and votes are closed.