You can write your topic however you like, but you must answer the following questions:
What do you want to achieve?
play the animation
What’s the problem?
the animation will not play, but the result prints the text
What solutions have you tried so far that work?
he tried to republish the animation twice
local Player = game.Players.LocalPlayer
local PlayerCharacter = Player.Character
local Humanoid = PlayerCharacter:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
local PreLoadedAnimations = game.ReplicatedStorage.Animations
local Animations = {
Rock_Chop = Animator:LoadAnimation(PreLoadedAnimations.TheRockChop)
}
local Tool = script.Parent
local Axe_sound = Tool.Handle.Axe
local Events = game.ReplicatedStorage.RemoteEvents
local Activated = false
Tool.Activated:Connect(function()
if not Activated then
Activated = true
Animations.Rock_Chop:Play()
Axe_sound:Play()
Axe_sound.Ended:Connect(function()
Activated = false
end)
end
end)
I don`t know why its no working. Animation and Game is Published to same group.
--You'll first need to define a humanoid if you haven't already
Tool.Activated:Connect(function()
if not Activated then
Activated = true
local Track = Humanoid:WaitForChild("Animator"):LoadAnimation(--[[Animation goes here]])
Animations.Rock_Chop:Play() --You'd play the track here using `Track:Play()` instead of
Axe_sound:Play()
Axe_sound.Ended:Connect(function()
Activated = false
end)
end
end)
For future reference note that you have to create an animation track to play the animation you’ve made. Not only that but you can also use the animation track to stop, and adjust the speed of your animation.
Tool.Activated:Connect(function()
if not Activated then
Activated = true
Animations.Rock_Chop:Play()
Axe_sound:Play()
Axe_sound.Ended:Connect(function()
Activated = false
end)
end
end)
Try substituting the if not Activated then With if Activated == false
local ahh = game.ReplicatedStorage.Animations
script.Parent.Activated:Connect(function()
local hum = script.Parent.Parent:WaitForChild("Humanoid")
local Animations = {
aha = hum:LoadAnimation(ahh.Animation)
}
Animations["aha"]:Play()
end)