I’m making a pose script and it works fine but, not when the character must return to their normal state (not posing) how do i detect an animation that’s playing inside of the humanoid?
I’m doing the pose animation like this.
> Posing.OnServerEvent:Connect(function(Player,active)
> if active == false then
> local Character = Player.Character
> local Humanoid = Character:WaitForChild("Humanoid")
> local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
>
> local timeStopped = workspace:FindFirstChild("TimeIsStopped")
> if timeStopped and not (timeStopped.Value == Player.Name) then
>
> Posing:FireClient(Player)
>
> return end
>
> local wry = Instance.new("Sound")
> wry.Volume = .15
> wry.SoundId = "rbxassetid://3460343038"
> wry.PlaybackSpeed = 1
> wry.Parent = game.Workspace
> wry:Play()
> debris:AddItem(wry,1)
>
> local randompose = math.random(1,2)
> if randompose == 1 then
>
> local Anim = Instance.new("Animation")
> Anim.AnimationId = "rbxassetid://4678320414"
> local Animation = Humanoid:LoadAnimation(Anim)
> Animation:Play()
>
> end
>
> end
> end)
after the function ends i don’t know how to localize the animation that’s ongoing so i can stop it.