How to spin a tool while holding using a script?

So, I am making a FPS game and I want to make it so when the gun’s ammo runs out the gun does a 360 and reload, (inspired by karlson 3d)

all i need to know is how on earth do I spin a tool that I am holding

my local script inside of the gun

gun.Equipped:Connect(function(mouse)
	mouse.Button1Down:Connect(function()
		if gun.Ammo.Value > 0 then
			Event:FireServer(gun.Handle.Position, mouse.Hit.p)
			shotSound:Play()
			gun.Ammo.Value = gun.Ammo.Value - 1
		else	
			local reloadDebouce = gun.reloadDebouce
			if reloadDebouce.Value == false then
				reloadDebouce.Value = true
				reload:play()
				wait(2.5)
				gun.Ammo.Value = 6
				reloadDebouce.Value = false
			end	
		end
	end)

end)

Milk Gang,

for i = 0,360,1 do
    local math = gun.Handle.CFrame * CFrame.Angles(0, math.rad(1), 0)
    gun.Handle.CFrame = gun.Handle.CFrame:Lerp(math, i/360)
2 Likes

Thank you i will try this see if it works
milk gang :smiley:

update: did not work, it kind of moves the player forward for some reason
robloxapp-20210411-1424104.wmv (661.7 KB)

Im clinically stupid sorry

for i = 0,360,10 do
    local math = gun.Handle.CFrame * CFrame.Angles(0, math.rad(10), 0)
    gun.Handle.CFrame = gun.Handle.CFrame:Lerp(math, i/360)
    wait()
end
1 Like

now it just drags me across the map
also nothing in output

robloxapp-20210411-1437034.wmv (638.2 KB)

1 Like

Can you post your script, because that kinda whack.

Here I rotated a part, and it works for me https://gyazo.com/3e000898662f099cacbd792f50682787

gun.Equipped:Connect(function(mouse)
	mouse.Button1Down:Connect(function()
		if gun.Ammo.Value > 0 then
			Event:FireServer(gun.Handle.Position, mouse.Hit.p)
			shotSound:Play()
			gun.Ammo.Value = gun.Ammo.Value - 1
		else	
			local reloadDebouce = gun.reloadDebouce
			if reloadDebouce.Value == false then
				for i = 0,360,10 do
					local math = gun.Handle.CFrame * CFrame.Angles(0, math.rad(10), 0)
					gun.Handle.CFrame = gun.Handle.CFrame:Lerp(math, i/360)
					wait()
				end
				reloadDebouce.Value = true
				reload:play()
				wait(2.5)
				gun.Ammo.Value = 6
				reloadDebouce.Value = false
			end	
		end
	end)

end)

> Blockquote

I think rotating tools, is different to rotating parts,
I am not sure though.

Sorry my Wi-Fi went down lemme quick get ya solution

1 Like

So since this is a tool (mb) it actually affects the whole humanoid root part meaning the whole character moves instead.

yeah, I noticed from my tests, my character keeps getting dragged.

Why don’t you just animate it my guy? Use motor6D:

3 Likes

Yeah that would make it easier than what I’m tryna pull off from his request.

500 iq, why didn’t I think for animating it lol

1 Like