I'm trying to make the gun that is in the player's hand do a 360 rotation when i press q, but when I press q, the gun teleports all around the place here is my block of code
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Enabled = false
Mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "q" and Enabled == false then
Enabled = true
lw = Player.Character.Welds.LeftArmWeld --This is the weld for the handle
lg = Player.Character.LeftGun.LeftHandle --The handle, everything is welded to this
e1 = CFrame.Angles(math.rad(180),0,0)
e2 = CFrame.Angles(math.rad(270),0,0)
e3 = CFrame.Angles(math.rad(360),0,0)
e4 = CFrame.Angles(math.rad(90),0,0)
for i = 0,1,1 do
lw.C0 = lg.CFrame:lerp(e1, i)
wait()
end
for i = 0,1,1 do
lw.C0 = lg.CFrame:lerp(e2, i)
wait()
end
for i = 0,1,1 do
lw.C0 = lg.CFrame:lerp(e3, i)
wait()
end
for i = 0,1,1 do
lw.C0 = lg.CFrame:lerp(e4, i)
wait()
end
wait(1)
Enabled = false
end
end)

1 comment
Mouse.KeyDown is deprecated! Deprecated deprecated deprecated! Why are you still using it!!? Seriously, dude.