DevStalin
|
  |
| Joined: 16 Jun 2012 |
| Total Posts: 34 |
|
|
| 20 Aug 2017 05:39 PM |
I can't figure out how to stop the Idle animation when I un-equip the knife. I've got a separate Bool Value and a script thats in charge of dealing damage to any humanoid, and I got both animations inside the local script. So if anyone can help me solve this I'd appreciate it.
------[Local Script]------
local CanAttack = true
script.Parent.Equipped:connect(function()
local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack) idle:Play()
script.Parent.Activated:connect(function() local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)
if CanAttack == true then attack:Play() idle:Stop() CanAttack = false wait(1) attack:Stop() idle:Play() CanAttack = true script.Parent.CanDamage.Value = true end end) end) |
|
|
| Report Abuse |
|
|
DevStalin
|
  |
| Joined: 16 Jun 2012 |
| Total Posts: 34 |
|
| |
|
DevStalin
|
  |
| Joined: 16 Jun 2012 |
| Total Posts: 34 |
|
|
| 20 Aug 2017 05:43 PM |
| Y'all just gonna keep looking but won't answer or anything? Savages |
|
|
| Report Abuse |
|
|
imepic457
|
  |
| Joined: 21 Dec 2012 |
| Total Posts: 212 |
|
|
| 20 Aug 2017 05:47 PM |
| set a function to when the tool is unequiped the idle animation will stop |
|
|
| Report Abuse |
|
|
imepic457
|
  |
| Joined: 21 Dec 2012 |
| Total Posts: 212 |
|
| |
|
DevStalin
|
  |
| Joined: 16 Jun 2012 |
| Total Posts: 34 |
|
|
| 20 Aug 2017 08:02 PM |
| I cant set it inside the if CanAttack == true then box because it would say "should end at etc" |
|
|
| Report Abuse |
|
|
imepic457
|
  |
| Joined: 21 Dec 2012 |
| Total Posts: 212 |
|
|
| 20 Aug 2017 08:10 PM |
| just add another end or end) at the end of the unequipped function |
|
|
| Report Abuse |
|
|