Only changing 1 axis?

I want to change the rotation of my part but only on the x asis any help?

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
db = false
Mouse.Button1Down:Connect(function()
	if db == false then
		db = true
		script.Parent.Handle.Shoot:Play()
		wait(0.1)
		script.Parent.Handle.Orientation = Vector3.new(10, 0, 0)
		wait(0.1)
		script.Parent.Handle.Orientation = Vector3.new(30, 0, 0)
		wait(0.1)
		script.Parent.Handle.Orientation = Vector3.new(10, 0, 0)
		wait(0.1)
		script.Parent.Handle.Orientation = Vector3.new(0, 0, 0)
		wait(0.5)
		db = false
	end
end)

whats the problem? char limitation

No just I need to change a rotation but only on the x axis without changing the y and x axis.

is your script running? because in your script your changing the x axis

ONLY CHANGE THE X AXIS, not making the others set to 0

you could change the β€œ=” to β€œ+=”

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
db = false
Mouse.Button1Down:Connect(function()
	if db == false then
		db = true
		script.Parent.Handle.Shoot:Play()
		wait(0.1)
		script.Parent.Handle.Orientation += Vector3.new(10, 0, 0)
		wait(0.1)
		script.Parent.Handle.Orientation += Vector3.new(30, 0, 0)
		wait(0.1)
		script.Parent.Handle.Orientation += Vector3.new(10, 0, 0)
		wait(0.1)
		script.Parent.Handle.Orientation += Vector3.new(0, 0, 0)
		wait(0.5)
		db = false
	end
end)

instead of vector3.new(10,0,0) use vector3.new(10,nil,nil)

adding onto this, i’d suggest using β€œ*=” instead since if you enter negative values in the vector3 and vice versa it will subtract instead of just adding

that does the same thing…

but it doesnt? vector3.new(10,0,0) sets the vectors X,Y,Z. however vector3.new(10,nil,nil) sets only the vectors X

try this for yourself, make a part in studio and run the following code:

game.Selection:Get()[1].Position = Vector3.new(10,nil,nil)

this is what happens:

The default parameters for the Y and Z components would be 0 nonetheless, so it is a bit redundant.

1 Like

Im going to remake this a different way thanks anyways!