• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Trash Globalevent

The Mapper

Just Imagine
Joined
Jul 22, 2009
Messages
182
Reaction score
2
Hey there, I need a script that randomizes trash all over the city, thank you :)
 
Lua:
local positions = {
	{x=100, y=100, z=7},
	{x=101, y=100, z=7},
}

local trash = {1234, 5678}

function onThink(interval, lastExecution, thinkInterval)
	for i = 1, #positions do
		doCreateItem(trash[math.random(#trash)], 1, positions[i])
	end
	return true
end
Code:
 	<globalevent name="CreateTrash" interval="600" event="script" value="scriptname.lua"/>
 
Last edited:
Do you want it not to create trash on tiles already containing trash? Do you want all positions to have a chance of not having trash created on them?
but is it possible for me to choose wich exact items I want to appear?
Fill table trash with the IDs you want.
 
all positions excepting protection zones.. and well I think houses and all that stuff, plus store with no pz square..
 
Back
Top