I want to do two different animations for when the character is holding the tool and when he is running.
For some reason the character stays in the toolnone animation in the Animate script instead of a new animation I added to the script called toolrun
The toolrun animation I added to the Animate script:
toolrun = {
{ id = "http://www.roblox.com/asset/?id=10447691210", weight = 10 }
},
toolnone = {
{ id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
}
This is the one I added in the AnimteTool function inside the Animate script:
if(toolAnim == "Run") then
playToolAnimation("toolrun", 0, Humanoid, Enum.AnimationPriority.Movement)
end
This is the function I added in the sword to make sure the animation plays when the character runs:
local function run()
local character = tool.Parent
local humanoid = character:WaitForChild("Humanoid")
RS.Stepped:Connect(function()
if humanoid.MoveDirection.Magnitude > 0 then
print(humanoid.MoveDirection.Magnitude)
print(true)
local str = Instance.new("StringValue")
str.Name = "toolanim"
str.Value = "Run"
str.Parent = tool
else
print(humanoid.MoveDirection.Magnitude)
print(false)
end
end)
end
tool.Equipped:Connect(run)
I set the toolnone animation’s priority to Idle and the toolrun animation priority to Movement but still no results. Am I missing something?