Working on ship Scripts and I need the guns to spin

I need to get the guns on my ship to spin, the whole ship is welded together I can rotate the guns using the roblox dev command bar.

workspace["USS Ranger Smells"].Gun3.Rotation.Orientation = Vector3.new(0,50,0)

However the same code in a script just doesn’t move the guns, no error and no movement I know the script gets that far as I have print statements above and below. I tried editing the CFrames of the weld to make the gun spin.

script.Parent.Gun3.Rotation.Weld.C0 = ( script.Parent.Gun3.Rotation.CFrame ):inverse()
script.Parent.Gun3.Rotation.Weld.C1 = ( script.Parent.Gun3.Rotation.CFrame * CFrame.Angles(0,math.rad(x),0)):inverse()

Which kind of worked but was very jerky any solutions?

Thanks in advanced,
– Gerald

I’m on mobile so bad formatting, but something like this is what I use.

Local model = —define here

While wait() do
model:SetPrimaryPartCframe(model.PrimaryPary.CFrame * Cframe.Angles(0, math.rad(2), 0))

end

I will give it a try now, :crossed_fingers: it works

Nope absolutely no movement at all.

Still nothing this should be spinning,

This is the model layout using welds to keep the ship together and weld constraints for the gun.