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.
Try making a part in the workspace that its position is the teleportation position and changing the code to workspace.Part.CFrame
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)