The problem is that you aren't loading the animation. You need the load the animation using a function called :LoadAnimation(). You use this function on the humanoid.
workspace.Player1.Humanoid:LoadAnimation(00000)
Another problem is variable t. For the humanoid is not in the Player but in the Character. You should also use :FindFirstChild() to find the humanoid and also check if it exists.
if game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") then
print("We found a humanoid!")
end
Output:
We found a humanoid!
Another problem is the walkspeed. WalkSpeed is a NumberValue not a string. So no "quotes" or 'these' or [[double square brackets.]]
Finished product:
local Anim = script:FindFirstChild("AnimationHolder")
local RunAnim = Anim:FindFirstChild("Atease")
local t = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
local mouse = game.Players.LocalPlayer:GetMouse()
local Animation = t:LoadAnimation(RunAnim)
mouse.KeyDown:connect(function(key)
if key.lower() == "z" and t then
Animation:Play()
t.WalkSpeed = 26
end
end)
1 comment
Please put your code in a code block.