Hello Everyone.
I have a problem with a Weight (Tool) i made 2 Animatiions 1 for Action 1 for Idle
My problem is that the idle animation plays like 2 secoonds and the lift animation does nothing.
(i'm new in LUA coding so sorry :) just knowing php)
Here is the code in the Tool.
local db = false local tool = script.Parent local plr = tool.Parent.Parent local character = plr.Character local strengthPerClick = 5 local anim1 = tool:WaitForChild("LiftAnim") local animtrack1 = character.Humanoid:LoadAnimation(anim1) local anim2 = tool:WaitForChild("IdleAnim") local animtrack2 = character.Humanoid:LoadAnimation(anim2) tool.Activated:Connect(function() if not db then db = true warn("Tool used") animtrack1:Play() plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value + strengthPerClick wait(1.5) db = false end end) tool.Equipped:Connect(function() warn("Tool Equipped") character.Humanoid.WalkSpeed = 0 animtrack2:Play() end) tool.Unequipped:Connect(function() warn("Tool Unequipped") character.Humanoid.WalkSpeed = 16 animtrack2:Stop() end)
Um I think you may of made a mistake, " plr = tool.Parent.Parent" That's all I'm going to say.