darcioantonio
www.adventurerpg.com.br
- Joined
- Jul 30, 2013
- Messages
- 170
- Solutions
- 1
- Reaction score
- 16
- Location
- Brasil
- GitHub
- darcioantonio
- Twitch
- darcio_
- YouTube
- MundoOTServer
Hi, good evening, is it possible to create an item in a certain random area?
I have a square and I want item 1746 to be created somewhere in the square.
I did this but it creates 1 item in every sqm of the whole area
I have a square and I want item 1746 to be created somewhere in the square.
I did this but it creates 1 item in every sqm of the whole area

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
Box()
end
local danoSupremo = {
fromposdaSupremo = {x = 1252, y = 1007, z = 4},
toposdaSupremo = {x = 1261, y = 1013, z = 4}
}
function Box()
for a = danoSupremo.fromposdaSupremo.x, danoSupremo.toposdaSupremo.x do
for b = danoSupremo.fromposdaSupremo.y, danoSupremo.toposdaSupremo.y do
pos = {x = a, y = b, z = 4, stackpos = 255}
doCreateItem(1746, 1, pos)
end
end
end