here is my code If you know what im doing wrong please tell me
local Tool = script.Parent local event = Tool:WaitForChild("RemoteEvent") event.OnClientEvent:connect(function(...) local tuple = {...} local anim = Tool:FindFirstChild(tuple[2]) if anim and humanoid then local loadedanim = humanoid:LoadAnimation(anim) if loadedanim then loadedanim:Play() if themouse then themouse.Icon = "rbxasset;//textures\\GunWaitCursor.png" wait(1) themouse.Icon = "rbxasset;//textures\\GunCursor.png" end end end Tool.Equiped:connect(function(mouse) themouse = mouse humanoid = Tool.Parent:FindFirstChild("Humanoid") if humanoid then local anim = Tool:FindFirstChild("IdleAnim3") if anim and humanoid then if loadedidleanim then loadedidleanim:Stop() end loadedIdleanim = humanoid:LoadAnimation(anim) if loadedIdleanim then loadedIdleanim:Play() end end end if themouse then themouse.Icon = "rbxasset;//textures\\GunCursor.png" end end) Tool.Unequipped:connect(function() if loadedIdleanim then loadedIdleanim:Stop() end end)
You're missing a lot of ends there buddy. For every if you need an end, and for every connect(function() you need an end).