Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

any idea why my idle animation doesnt go back to the original one?

Asked by 4 years ago

So I have a Animate localscript in Startercharacterscripts with some custom animations, and I have a tool/ability that changes your animations. I made 2 folders in ReplicatedStorage that each have 1 animate script, 1 which has the original one (the one in startercharacterscripts), and the other which has different animations which the tool uses. When I activate the tool the animations work fine, but when I disable the tool the animations don't change back, please help! heres the server script inside the tool:

001local Tool = script.Parent
002local Cooldown = false
003local CDTime = 6
004local HPBuff = 50
005local WalkSpeedBuff = 15
006 
007Tool.OpenEvent.OnServerEvent:Connect(function(plr)
008if Cooldown then return end
009 
010spawn(function()
011    plr.Character:FindFirstChild("Pants"):Destroy()
012    plr.Character:FindFirstChild("Shirt"):Destroy()
013    Cooldown = true
014    wait(CDTime)
015    Cooldown = false
View all 102 lines...

1 answer

Log in to vote
0
Answered by
WBlair 35
4 years ago

They don't change back because you destroyed the original animation.

1plr.Character.Animate:Destroy()

You should instead just clone the original animation script to somewhere in your character (not directly in it, I'd say a folder or something).

And then you can run a unequipped connection to give the original animations back to your character with:

1plr.Character["Some Folder"].Animate.Parent = plr.Character

You can then destroy the other animations other than the original one inside the unequipped connection.

0
Ok, I will try this Sabertooth11123 38 — 4y
Ad

Answer this question