#stop animation
27 messages · Page 1 of 1 (latest)
animation will not stop playing and keeps on looping
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local animation = Instance.new("Animation")
animation.AnimationId = script.handsAction.AnimationId
local animation1 = Instance.new("Animation")
animation1.AnimationId = script.handsAction.handsLoop.AnimationId
local track = humanoid:LoadAnimation(animation)
local track1 = humanoid:LoadAnimation(animation1)
local wait0 = track.Length
if player.handsVar.Value == false then
player.handsVar.Value = true
track:Play()
task.wait(wait0)
track1.Looped = true
track1:Play()
else
track.Looped = false
track1.Looped = false
track1:Stop()
track:Play()
player.handsVar.Value = false
end
end)
@rapid raft
pinged random scripter sorry for ping
but I would think this would have a simple fix
not very familier with anim
setting looped via script does not work you have to set it in the animation itself in the editor.
It is set as looped as an animation
That’s how I exported it
But when I call the function when the variable is true it just plays the first animation (track) then keeps looping the 2nd animation (track1)
a couple things. animations shouldn't be played on the server, period. You can't load the animation over and over and cancel the last one it doesn't work that way you're creating a new animtrack object each time.
I should do this on a local script then?
Then it will only be client sided then
Unless animations are always server sided
alright thanks I figured it out with the help of chat GPT (I used this comment as a way for chatGPT to remake my code)
that won't work
with multiple players in the game
but that is part of the solution for a localscript
@eager stream
This is in serverscript
If u used a local script the animation won’t be server sided right?
Unless ur tryna tell me to use parameters
Animations aren't server sided anyways client has network ownership of animations
i figured it out thanks
** You are now Level 3! **