It's easy buddy. There is many ways you can do this. I will put 2 of these right below.
Teleport a player to a position when clicking something:
script.Parent.ClickDetector.MouseClick:connect(function()
local player = game.Players.LocalPlayer
local playername = player.Name
game.Workspace:WaitForChild(playername).Torso.CFrame = CFrame.new(Enter position here)
end)
Now if you want a player to teleport when touching a part:
script.Parent.Touched:connect(function(hum)
local player = game.Players.LocalPlayer
local playername = player.Name
hum.Parent:WaitForChild("Humanoid")
game.Workspace:WaitForChild(playername).Torso.CFrame = CFrame.new(Enter position here)
end)
I hope I helped you!
8 comments
Don't Position and MaxForce need an uppercase at the beginning?
I don't think so since it does move the player. The BodyPosition doesn't move the player to the part's Position.
Try: game.Workspace:WaitForChild("Point").Position
Tried with no success :(
Oh I know, you are creating a new Vector3 when Position is already a Vector3
Just use b.Position = game.Workspace.Point.Position
It worked :D Thanks
:D Welcome