Infinite loop?


I keep getting an error with some code
includes/modules/usermessage.lua:77: Infinite Loop Detected!

The code is really long so I’ll just post the erroring part, but if you want me to I will post it all. Please help :slight_smile: Thanks.

timer.Simple(10, function()
SendUserMessage(“UnlockedWeaponsToClient”, v, v.StringOfWeapons)

– I added the timer to try to stop the infinite loop, but it still happens when the timer has finished and the usermessage is sent.


function ReceiveUnlockedWeapons(um)
UnlockedWeapons = string.Explode(“END”, um:ReadString())
for k,v in pairs(UnlockedWeapons) do
table.insert(UnlockedWeapons, v)
usermessage.Hook(“UnlockedWeaponsToClient”, ReceiveUnlockedWeapons)

while true


do end

So for every entry in the UnlockedWeapons table, add another entry…? That loop will go on for ever then = infinite loop.

Ok thanks, I was looking at the usermessage and didn’t look at what I was doing with the tables. :stuck_out_tongue: