Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would i get my part to move in the direction its facing?

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)

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.