Tbol
Well-Known Member
- Joined
- Apr 7, 2019
- Messages
- 529
- Reaction score
- 56
Hello so i making this code i though i made everything correctly but it doesnt spawn items around the map. Not sure what i did wrong (no errors in console tho)
Lua:
local areas = {
positions = {
Position(218, 113, 7),
Position(312, 339, 7),
Position(282, 200, 7)
}
}
function onThink(interval)
if not items or not next(items) then
return true
end
local itemId = items[math.random(#items)]
local position = areas.positions[math.random(#areas.positions)]
local item = Game.createItem(itemId, 1, position)
if not item then
return true
end
broadcastMessage(string.format("Item was spawned somewhere", MESSAGE_STATUS_WARNING))
return true
end