Infinite loop?

SOLVED

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.

Server
[lua]
timer.Simple(10, function()
SendUserMessage(“UnlockedWeaponsToClient”, v, v.StringOfWeapons)
end)

– 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.
[/lua]

Client

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

while true

[editline]02:11PM[/editline]

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: