-
What do you want to achieve?
I want an animation to play. -
What is the issue?
The animation works just fine but when it plays the tool is stuck in the same place.
The animationpriority is set to Movement.
But my running animation works just fine.
This is the walking script.
local function loadAnims(char)
local hum = char:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")
for _, track in pairs(animator:GetPlayingAnimationTracks()) do
track:Stop(0)
end
local animscript = char:WaitForChild("Animate")
animscript.walk.WalkAnim.AnimationId = "rbxassetid://10135238949"
end
local function onPlayeradded(player)
player.CharacterAppearanceLoaded:Connect(loadAnims)
end
game.Players.PlayerAdded:Connect(onPlayeradded)
and if you want to compare here is the running animation:
--variables
local userinput = game:GetService("UserInputService")
local replicatedstorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local yScale = players.LocalPlayer.PlayerGui.CombatInfo.RunStamina.Size.Y.Scale
local xScale = players.LocalPlayer.PlayerGui.CombatInfo.RunStamina.Size.X.Scale
local char = players.LocalPlayer.Character or players.LocalPlayer.CharacterAdded:Wait()
local animator = players.LocalPlayer.Character:WaitForChild("Humanoid"):FindFirstChild("Animator")
local anim = animator:LoadAnimation(replicatedstorage.Animation)
userinput.InputBegan:Connect(function(objecet, processed)
if not processed then
if objecet.KeyCode == Enum.KeyCode.LeftShift then
print("Test2")
replicatedstorage.Sprint:FireServer("Began")
anim:Play()
end
end
end)
userinput.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
replicatedstorage.Sprint:FireServer("Ended")
anim:Stop()
end
end)
replicatedstorage.staminaUpdate.OnClientEvent:Connect(function(stamina, maxstamine)
players.LocalPlayer.PlayerGui.CombatInfo.RunStamina.Size = UDim2.new((stamina/maxstamine) * xScale, 0,yScale,0)
end)
replicatedstorage.staminaranout.OnClientEvent:Connect(function()
anim:Stop()
end)
Hope you can help!