local dronefacing function droneMovement(player,keypressed,direction) if keypressed == "w" then Bodypos.Position = Bodypos.Position + Vector3.new(0,0,-1) elseif keypressed == "a" then Bodypos.Position = Bodypos.Position + Vector3.new(-1,0,0) elseif keypressed == "s" then Bodypos.Position = Bodypos.Position + Vector3.new(0,0,1) elseif keypressed == "d" then Bodypos.Position = Bodypos.Position + Vector3.new(1,0,0) end if direction == "Right" then drone.CFrame = CFrame.new(Bodypos.Position, CFrame.Angles(math.rad(1,0,0))) end if direction == "Left" then drone.CFrame = CFrame.new(Bodypos.Position, CFrame.Angles(0,0,math.rad(-1))) end local dronefacing = drone.CFrame.LookVector end droneserver.OnServerEvent:Connect(droneMovement)
I recommend using LookVector, RightVector or UpVector https://scriptinghelpers.org/questions/14747/what-is-lookvector-and-how-do-i-use-it
Closed as Non-Descriptive by JesseSong
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?