generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Fixing this Knife script

Previous Thread :: Next Thread 
DevStalin is online. 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 is online. DevStalin
Joined: 16 Jun 2012
Total Posts: 34
20 Aug 2017 05:42 PM
Bump
Report Abuse
DevStalin is online. 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 is online. 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 is online. imepic457
Joined: 21 Dec 2012
Total Posts: 212
20 Aug 2017 06:43 PM
well did it work?
Report Abuse
DevStalin is online. 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 is online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image