What i want to achieve is the player shooting the glock and the slide of the glock going backwards, ive animated it in moon animator and it works perfectly there. However the slide and the gun dont seem to move at all, only the arms are animated when the player shoots.
I’ve tried tinkering with it and looking around devforum for solutions, but i have found none that help.
This is the gun model :
this is the code for equipping the gun :
game.ReplicatedStorage.EquipGun.OnServerEvent:Connect(function(plr,gun,val)
local char = plr.Character
local hum = char:FindFirstChildWhichIsA("Humanoid")
if val == "Equip" then
local Gun = game.Workspace:FindFirstChild(gun):Clone()
Gun.Parent = char
Gun.Handle.Part0 = plr.Character["Right Arm"]
Gun.Handle.Part1 = Gun.HandleGun
Gun.Handle.Enabled = true
Gun.HandleGun.MoveBackPart.Part1 = Gun.MoveBackPart
local anim = plr.Character:FindFirstChildWhichIsA("Humanoid"):LoadAnimation(game.Workspace.Animations:FindFirstChild(gun):FindFirstChild(gun.."IdleNormal"))
anim:Play()
char.GunEquipped.Value = true
elseif val == "UnEquip" then
char.GunEquipped.Value = false
char:FindFirstChild(gun):Destroy()
for _,v in ipairs(hum:GetPlayingAnimationTracks()) do
if v.Name == gun.."IdleNormal" then
v:Stop()
end
end
end
end)
--
This is the code for shooting the gun :
game.ReplicatedStorage.GunFire.OnServerEvent:Connect(function(plr,gunname,val)
local char = plr.Character
local hum = char:FindFirstChildWhichIsA("Humanoid")
if val == false then
print("Fire")
local anim = plr.Character:FindFirstChildWhichIsA("Humanoid"):LoadAnimation(game.Workspace.Animations:FindFirstChild(gunname):FindFirstChild(gunname.."FireShot"))
anim:Play()
end
end)
Help would be appreciated :slight_smile: