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 4 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 4 years ago
local player = game.Players.LocalPlayer
local char = player.Character
local where = Vector3.new(0,0,0)

char:MoveTo(where)
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
--This should move your character for the whole server instead locally.

script.Parent.Touched:Connect(function(hit)

if hit.Parent:FindFirstChild("Humanoid") then

hit.Parent.HumanoidRootPart.CFrame=Vector3.new(0,0,0) --Place your position

end)

Answer this question