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.
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.