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 » Scripting Helpers
Home Search
 

Equipping tool once runs onEquipped 10 times!

Previous Thread :: Next Thread 
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
20 May 2014 09:21 AM
When I equip my gun it runs the equipped method 6 times til it reached maximum reentry depth.

It's very frustrating to work with.
The unequip method does not run 6 times.
So why does it behaiv like this? And is there a solution for this bug?

My code (localscript):
Tool.Equipped:connect(onEquippedLocal)
Tool.Unequipped:connect(onUnequip)
Report Abuse
masterCameron101 is online. masterCameron101
Joined: 28 Mar 2010
Total Posts: 1377
20 May 2014 09:24 AM
Is that the script? >.>

~masterCameron101, advanced Lua programmer, certified in Photoshop. Have I helped you? Don8~
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
20 May 2014 11:10 AM
It'd be easier for me to identify whats wrong if I could see more of the script :P
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
20 May 2014 11:12 AM
You can probably add a debounce to the equipped function until the tool is unequipped so it doesn't fire that.

If you are calling OnEquipped somewhere else, that might be causing the stack overflow because you are infinitely calling the function.
Report Abuse
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
20 May 2014 06:02 PM
Yeah I used my own variable to solve the issue.
Problem is, this maximum reentry error occures on somethings as simple as a textbutton.

Reason more code wasn't given was because I was certain it was not the issue and it would only confuse the reader.
Thanks anyways guys :)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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