07-22-2011, 02:02 PM
I got an error when a script cloned a model from Storage
|
07-22-2011, 02:47 PM
Can you post your code?
07-22-2011, 02:51 PM
Unfortunately not -- it was a fatal error and wiped out my script.
It was something along the lines of [lua] table1 = {} stuff = game.Storage:getChildren() for q = 1, #stuff do if stuff[q]:isA("Model") then table.insert(table1, stuff[q]) end end function PickItem() local item = table1[math.random(1, #table1)] return item end while true do sleep(10) local players = game.Players:getChildren() if #players > 0 then local item = PickItem():clone() item.Parent = game.World sleep(100) item:remove() end end [/lua] There were a few other little bits -- messages and a sort of clock -- but I think that's the skeleton of the script.
07-22-2011, 03:44 PM
Remember to always use gamecheduleTask(). That could be causing your problem.
I'll try and see if that works.
I didn't even run the script and this happened. error Wrote:java.lang.NegativeArraySizeException
07-23-2011, 01:48 PM
(07-23-2011, 12:53 PM)Qwertygiy Wrote: I'll try and see if that works. Can you send me the game file? Never seen that one before...
07-23-2011, 01:48 PM
Alright, I'll go back into Build and rebuild the script and then save it.
07-23-2011, 01:50 PM
I didn't bother clicking it; it crashed before the script could run so I figured it wouldn't be worth it when I have the script pretty much written down here and the main World saved online.
Here's the game, with the script written the way it was when that last error happened. |
« Next Oldest | Next Newest »
|
Users browsing this thread: 1 Guest(s)