A Roblox Community

A community of Robloxians who want to learn to script and build on Roblox Studio.
 
HomeFAQRegisterLog in
If you're a experienced coder make some tutorials! It would really help the site grow.
Make sure you read the rules(Which can be found by clicking here)
If you're a beginner at coding, try some tutorials.
We have many Moderators/Admins watching this site. Contact them with Questions.
Let us know what your favorite sport is. By clicking here to vote (Click here)
This site is becoming inactive. Lets make it active.
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Top posters
blueymaddog
 
naknak
 
Supernapalm
 
m27frogy
 
slayer9365
 
myrco919
 
branefreez
 
ninga95
 
CloneTrooper787
 
raboy117
 
Top posting users this month
Latest topics
» Send me an Email
January 8th 2016, 10:14 am by naknak

» [v1.6.0.0] Lua Script Obfuscator [No Bytecode]
July 6th 2015, 7:38 pm by m27frogy

» New Site Possibly
July 6th 2015, 4:16 pm by m27frogy

» Ambassador!
April 15th 2015, 11:40 pm by naknak

» Boop - Tag
April 13th 2015, 9:46 pm by naknak

» Vip Class Script
April 13th 2015, 4:54 pm by naknak

» Who's active?!
April 13th 2015, 4:52 pm by naknak

» Where to go from here.
April 13th 2015, 4:51 pm by naknak

» Genesis Point
July 17th 2014, 7:04 pm by branefreez

» Reward System
July 17th 2014, 5:41 am by m27frogy

» Script Request
July 10th 2014, 11:43 am by naknak

» local scripts?
July 10th 2014, 11:39 am by naknak

» Project: Reconstruction [Died]
July 10th 2014, 11:36 am by naknak

» Hi. I am new here
April 26th 2014, 4:01 pm by altshiftkey

» What's your favorite sport?
January 1st 2014, 2:13 pm by m27frogy

» FlashLight Script
January 1st 2014, 2:11 pm by m27frogy

» Gun Making! [READ DESC]
January 1st 2014, 2:10 pm by m27frogy

» Hi, I am new here!
November 26th 2013, 3:33 pm by Keanu73

» Improve Coding
October 26th 2013, 1:12 pm by pook03

» Simple Button
September 1st 2013, 6:19 pm by branefreez


Share | 
 

 Why am I exceeding the re-entrancy depth?

View previous topic View next topic Go down 
AuthorMessage
tgp1994
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 17
Join date : 2012-06-27

PostSubject: Why am I exceeding the re-entrancy depth?   September 27th 2012, 7:38 pm

Hi everyone,

I'm having a weird issue where, when my tool is equipped, my onSelected function runs six times, then the script is terminated, with the output saying maximum event re-entrancy depth exceeded.

Looking at a snippet of my code,

Code:
me = nil --Tools are placed in the Character model when they're taken out, this variable must be set once the tool is taken out.
msg = nil

function onSelected(mouse)
   print("Selected Local")
   me = script.Parent.Parent
   mouse.Icon = Cursor["gun"]
   --mouse.Button1Down:connect(function() onButton1Down(mouse) end)
   --mouse.Button1Up:connect(function() onButton1Up(mouse) end)
   --mouse.Idle:connect(function() Idle(mouse) end)
   --mouse.KeyDown:connect(keypush)
   msg = Instance.new("Message")
   msg.Parent = me
   msg.Text = ""
   print("Message placed in "..tostring(me))
end

bin.Equipped:connect(onSelected)

can anyone tell why this function is being repeated multiple times when it should only run once?
Back to top Go down
m27frogy
The Garbageman
avatar

Posts : 336
Join date : 2011-06-23

PostSubject: Re: Why am I exceeding the re-entrancy depth?   October 28th 2012, 8:14 pm

This error means that too many events immediatly fire the same event which fires the same event again and into infinity....
Back to top Go down
tgp1994
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 17
Join date : 2012-06-27

PostSubject: Re: Why am I exceeding the re-entrancy depth?   October 28th 2012, 9:34 pm

Thanks for the help frogy,

I posted this on the roblox forums, and it turned out to be something a little more complicated than that - it actually was a bug in roblox its self. The suggested temporary workaround was to put a wait(0) command at the beginning of the hooked function that was causing the issue. I hope this bug gets fixed soon :\
Back to top Go down
m27frogy
The Garbageman
avatar

Posts : 336
Join date : 2011-06-23

PostSubject: Re: Why am I exceeding the re-entrancy depth?   October 30th 2012, 4:41 pm

That is odd, I'm glad your issue was fixed! PS, you might want to update your avatar. I change d it for you! ;)
Back to top Go down
branefreez
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 143
Join date : 2012-07-14

PostSubject: Re: Why am I exceeding the re-entrancy depth?   October 31st 2012, 12:45 pm

do

[code]local debounce = true

if (debounce == true) do
blah blah onEquipped blah blah
debounce = false

STUFF................
end
Back to top Go down
http://www.roblox.com/User.aspx?ID=22724483
tgp1994
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 17
Join date : 2012-06-27

PostSubject: Re: Why am I exceeding the re-entrancy depth?   October 31st 2012, 1:41 pm

m27frogy wrote:
PS, you might want to update your avatar. I change d it for you! ;)

Oh, was that thing old? I never really noticed, thanks for getting it for me though :)

branefreez wrote:
do

[code]local debounce = true

if (debounce == true) do
blah blah onEquipped blah blah
debounce = false

STUFF................
end

Yeah, it was the weirdest thing... I actually tried the debounce method first (that was the first suggestion over at roblox), and for some reason, (as best as I can remember) I was still getting the same results, more or less. I don't completely understand why that wouldn't work where the wait(0) method would, but I sure like it since it's less code :)
Back to top Go down
m27frogy
The Garbageman
avatar

Posts : 336
Join date : 2011-06-23

PostSubject: Re: Why am I exceeding the re-entrancy depth?   October 31st 2012, 2:46 pm

It's sure odd.
Back to top Go down
branefreez
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 143
Join date : 2012-07-14

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 1st 2012, 3:27 pm

It is.... But it's nice to know that there are more than just two people active on the forum.
Back to top Go down
http://www.roblox.com/User.aspx?ID=22724483
tgp1994
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 17
Join date : 2012-06-27

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 1st 2012, 5:43 pm

Hate to go offtopic, but is activity an issue here?
Back to top Go down
branefreez
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 143
Join date : 2012-07-14

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 1st 2012, 7:16 pm

Nope. Not really, but I was just showing my happiness that you are also active.
Back to top Go down
http://www.roblox.com/User.aspx?ID=22724483
tgp1994
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 17
Join date : 2012-06-27

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 1st 2012, 7:21 pm

Oh, why thank you :) I'm glad to be active here.
Back to top Go down
m27frogy
The Garbageman
avatar

Posts : 336
Join date : 2011-06-23

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 2nd 2012, 12:17 pm

Well, I'll promote you, since I can see you're better than a novice. :D
Back to top Go down
branefreez
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 143
Join date : 2012-07-14

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 2nd 2012, 3:04 pm

That's very kind of you to do for him. Thank you! And, Welcome to being a Moderate Scripter, tgp1994!
Back to top Go down
http://www.roblox.com/User.aspx?ID=22724483
tgp1994
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 17
Join date : 2012-06-27

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 2nd 2012, 6:34 pm

Thank you both :) I wish I was more active on ROBLOX to better deserve the title, but I appreciate it nonetheless.
Back to top Go down
branefreez
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 143
Join date : 2012-07-14

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 3rd 2012, 2:01 pm

Hey, as long as you are active to some extent, we appreciate it. You are helping to keep the forum alive.
Back to top Go down
http://www.roblox.com/User.aspx?ID=22724483
m27frogy
The Garbageman
avatar

Posts : 336
Join date : 2011-06-23

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 5th 2012, 8:01 pm

Yup. Couldn't have coined it better.
Back to top Go down
MrNicNac
Expert Scripter
Expert Scripter
avatar

Posts : 25
Join date : 2011-03-06
Age : 21

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 13th 2012, 9:07 am

If you're still having issues with this, I can look at the code for you and definitely give you a fix. I've had problems like this multiple times.
Back to top Go down
branefreez
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 143
Join date : 2012-07-14

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 13th 2012, 4:07 pm

Hey, MrNicNac! Nice to see you, again! [Even though I've never met you>:3 ]. I'm sure they would love having your help on their probloems.
Back to top Go down
http://www.roblox.com/User.aspx?ID=22724483
tgp1994
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 17
Join date : 2012-06-27

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 13th 2012, 11:35 pm

I appreciate the offer, MrNicNac! I think the wait command actually worked very well for the script (and for me, I might add :P) If you have a better solution, would you mind posting it here so the community can benefit from it?
Back to top Go down
MrNicNac
Expert Scripter
Expert Scripter
avatar

Posts : 25
Join date : 2011-03-06
Age : 21

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 14th 2012, 9:21 am

No, my offer would have been to add a wait somewhere as well.

I just have to ask, however, did you use a LocalScript?
Back to top Go down
tgp1994
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 17
Join date : 2012-06-27

PostSubject: Re: Why am I exceeding the re-entrancy depth?   November 14th 2012, 9:28 pm

MrNicNac wrote:

I just have to ask, however, did you use a LocalScript?

I'm trying to think back... I was going back and forth between a LocalScript and a regular script, because I needed to interact with the world, yet I was hearing stories that the localscript would be a solution (although I don't remember switching to one actually fixing anything). It seemed like it would be much more easier leaving the script as a serverside script, so I think I may have left it serverside.
Back to top Go down
Sponsored content




PostSubject: Re: Why am I exceeding the re-entrancy depth?   

Back to top Go down
 
Why am I exceeding the re-entrancy depth?
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» houdini settings?
» Deep Rybka 4.1 live on IPON
» coreect threads ,split depth,contempt
» Opennig Book *.abk
» Persona 3 - Height of Tartarus, Depth of Eternrus - Spots still Open and Still can Join - START

Permissions in this forum:You cannot reply to topics in this forum
A Roblox Community :: Questions and Help :: Scripting-
Jump to: