• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Automatic nature

Spoking

Oldschool Developer
Joined
Sep 4, 2007
Messages
434
Reaction score
34
Hello everyone,

I've made this script a long time ago, when I was still in scripting and OTS etc. But since I quit with that anyways, I can share a script I made back then. You can expand the script however you want, make it yours, make the most epic script ever from this one.. It's all fine.

xpos1 = xpos top left corner
ypos1 = ypos top left corner
xpos2 = xpox bottom right corner
ypos2 = ypos bottom right corner

Code:
function onSay(cid, words, param, channel)
	local config = {
	xpos1 = 960,
	xpos2 = 1047,
	ypos1 = 950,
	ypos2 = 1018,	
	trees = {2700, 2701, 2702, 2703, 2707, 2708, 2740, 2772, 4156}
	}
	
	
	
	for i = config.xpos1, config.xpos2 do
		for u = config.ypos1, config.ypos2 do
			for k = 4526, 4541 do
				if getThingFromPos({x=i, y=u, z=7, stackpos=0}).itemid == k and getThingFromPos({x=i, y=u, z=7, stackpos=1}).itemid < 1 then
				local randomness = math.random(1,4)
				local randomnezz = math.random(1,10)
				local randomnexx = math.random(1,10)
				local randomstone = math.random(1,15)
					if randomness == 2 then
						doCreateItem(math.random(2767,2768), {x=i, y=u, z=7})
					elseif randomnezz == 3 and randomness ~= 2 then
						doCreateItem(config.trees[math.random(1,#config.trees)], {x=i, y=u, z=7})
					elseif randomnezz ~= 3 and randomness ~= 2 and math.random(1,10) <= 6 then
						doCreateItem(math.random(6218,6219), {x=i, y=u, z=7})
					elseif randomnezz ~= 3 and randomness ~= 2 and randomnexx > 6 and randomstone == 13 then
						doCreateItem(math.random(3621,3623), {x=i, y=u, z=7})
					end
				end
			end
		end
	end
	return true
end

Kind regards,

Spoking
 
Maybe pops up some ideas for people to work this out =)
 
Back
Top