Hello, I need help with my teleport script. The teleport script teleport you to a position.
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then hit.Parent.Head.CFrame = CFrame.new(--MY POSITION WANT TELLEPORTED--) end end)
It does work in all, but when I publish the game it wont teleport me. Please help!
If you can help please send me the script or send me the instructions
to how to fix it. Thanks
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then local Players = game:GetService("Players") local TeleportService = game:GetService("TeleportService") local placeId = 0 -- replace here local userId = 1 -- replace with player's userId -- find the player local player = Players:GetPlayerByUserId(userId) -- teleport the player TeleportService:Teleport(placeId, player) end end)
--Put this inside a part
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then hit.Parent:MoveTo(Vector3.new(0, 0, 0)) -- ADJUST HERE end end)