Furkan5E
(Furkan5E)
April 11, 2021, 1:11pm
#1
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
Furkan5E
(Furkan5E)
April 11, 2021, 1:22pm
#3
Thank you i will try this see if it works
milk gang
Furkan5E
(Furkan5E)
April 11, 2021, 1:26pm
#4
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
Furkan5E
(Furkan5E)
April 11, 2021, 1:38pm
#6
CreepingGamingTV:
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
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
Furkan5E
(Furkan5E)
April 11, 2021, 1:43pm
#8
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
Furkan5E
(Furkan5E)
April 11, 2021, 1:46pm
#9
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.
Furkan5E
(Furkan5E)
April 11, 2021, 2:02pm
#12
yeah, I noticed from my tests, my character keeps getting dragged.
RFL890
(GeorgeCatherington)
April 11, 2021, 2:04pm
#13
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.
Furkan5E
(Furkan5E)
April 11, 2021, 2:10pm
#16
500 iq, why didn’t I think for animating it lol
1 Like