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

How do I cframe a player in position when they touch a part?

Asked by 5 years ago

Hey, I was wondering how I'd make it so once a player touches a part the player moves ina position using c frame (e.g. facing forward), how would I do this? :)

2 answers

Log in to vote
0
Answered by 5 years ago
1local player = game.Players.LocalPlayer
2local char = player.Character
3local where = Vector3.new(0,0,0)
4 
5char:MoveTo(where)
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
1--This should move your character for the whole server instead locally.
2 
3script.Parent.Touched:Connect(function(hit)
4 
5if hit.Parent:FindFirstChild("Humanoid") then
6 
7hit.Parent.HumanoidRootPart.CFrame=Vector3.new(0,0,0) --Place your position
8 
9end)

Answer this question