I think this is not self-explanatory it dosen’t stop when i unequip
local Path = script.Parent.Idle
script.Parent.Equipped:Connect(function()
local Humanoid = script.Parent.Parent:FindFirstChild(‘Humanoid’)
local Idle = Humanoid:LoadAnimation(Path)
Idle:Play()
end)
script.Parent.Unequipped:Connect(function()
local Humanoid = script.Parent.Parent:FindFirstChild(‘Humanoid’)
local Idle = Humanoid:LoadAnimation(Path)
Idle:Stop()
end)
1 Like
7z99
(cody)
May 21, 2021, 11:53pm
2
It isn’t self-explanatory, we can’t guess. What is the issue you are having?
So when i unequip it doesn’t stop
SuperKTJ
(DonutDude)
May 21, 2021, 11:54pm
4
Is it saying anything in the console?
Pooglies
(Pooglies)
May 21, 2021, 11:55pm
5
Try this
local Idle= nil
local Path = script.Parent.Idle
script.Parent.Equipped:Connect(function()
local Humanoid = script.Parent.Parent:FindFirstChild(‘Humanoid’)
Idle = Humanoid:LoadAnimation(Path)
Idle:Play()
end)
script.Parent.Unequipped:Connect(function()
local Humanoid = script.Parent.Parent:FindFirstChild(‘Humanoid’)
Idle:Stop()
Idle = nil
end)
Ty so much
also can you explain nil thingy?
Pooglies
(Pooglies)
May 21, 2021, 11:59pm
7
nil basically means its got no value, so when you set it to nil, it obviously has no value, so when they equip it, it gives that idle a value, and it then carries to the unequip since the local part of it isnt in that specific function, then we set it back to nil just cause
1 Like