local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
-- Animation
local Roll = game.ReplicatedStorage.ClientAnimations.Roll
script.Parent.Equipped:Connect(function()
local RollAnimationTrack = Humanoid.Animator:LoadAnimation(Roll)
script.Parent.Activated:Connect(function()
RollAnimationTrack:Play()
end)
end)
I even tried to make the animation play serversided but still got the same problem
local Player = (script.Parent:FindFirstAncestorWhichIsA("Model") or script.Parent:FindFirstAncestorWhichIsA("Player"))
-- Animation
local Roll = game.ReplicatedStorage.ClientAnimations.Roll
script.Parent.Equipped:Connect(function()
local RollAnimationTrack = Player.Character.Humanoid:LoadAnimation(Roll)
script.Parent.Activated:Connect(function()
RollAnimationTrack:Play()
end)
end)
Can you try this script and see is there trouble with your print function? if there is no error so give the last text of your print function in output. when you activate your tool
print("Game Started")
local Player = game.Players.LocalPlayer
print("Get Player ".. Player.Name)
local Character = Player.Character or Player.CharacterAdded:Wait()
print("Get Character ".. Character.Name)
local Humanoid = Character:WaitForChild("Humanoid")
print("Get Humanoid ".. Humanoid.Name)
-- Animation
local Roll = game.ReplicatedStorage.ClientAnimations.Roll
print("Get Animation ".. Roll.AnimationId)
script.Parent.Equipped:Connect(function()
print("Tool Equiped")
local RollAnimationTrack = Humanoid.Animator:LoadAnimation(Roll)
print("Load Animation")
script.Parent.Activated:Connect(function()
print("Tool Activated")
RollAnimationTrack:Play()
print("Animation Play")
end)
end)
but if print function works fine then the problem is probably about your animation did you forget to add animation id or invalid animation id?
Local character = script.Parent.Parent
Local RollAnimationTrack
script.Parent.Activated:Connect(function()
if RollAnimationTrack then
RollAnimationTrack = character.Humanoid:LoadAnimation(Roll)
RollAnimationTrack:Play()
end
end)
local character = script.Parent.Parent
local RollAnimationTrack
script.Parent.Activated:Connect(function()
if RollAnimationTrack then
RollAnimationTrack = character.Humanoid:LoadAnimation(Roll)
RollAnimationTrack:Play()
else
warn("No roll animation track!")
end
end)
If it’s not working I’ll find out later. DM for any bugs