local humanoid = plr.Character:FindFirstChildOfClass("Humanoid")
local function loadanimation(anim)
return humanoid.Animator:LoadAnimation(anim)
end
local Anim = {
Equipped = loadanimation(script.Parent.EquipAnim)
}
tool.Equipped:Connect(function()
if not Anim.Equipped.IsPlaying then Anim.Equipped:Play() end
... code
end)
local ss = game:GetService("ServerStorage")
local event = game:GetService("ReplicatedStorage").Events.Inventory.GiveItem
event.OnServerEvent:Connect(function(plr, item)
if item ~= "N/A" then
local i = ss.Inventory[plr.Name][item]
local char = plr.Character -- gets the player's character
local hum = char:FindFirstChildOfClass("Humanoid") -- get the humanoid
i.Parent = char
end
end)
By the way, EquipTool does not work so I updated the parent.