• 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!

Request Bomberman script please!

Jo3ii

New Member
Joined
Dec 30, 2009
Messages
40
Reaction score
0
Hello i want a bomberman script for my server and heres and images that this server have.

92953467.png



You need 4 players to start this bomberman and when typeing Z then you drop the bomb.
When player want to enter the teleport they need to be naked.

Please help me:)
 
So i was trying to do this and failed... big...
Lua:
local function bomb(x, pos)
 local C = 0
 local From = 
 {
        {x = pos.x + 2, y = pos.y, z = pos.z}, 
        {x = pos.x, y = pos.y - 2, z = pos.z},
        {x = pos.x - 2, y = pos.y, z = pos.z}, 
        {x = pos.x, y = pos.y + 2, z = pos.z},
        {x = pos.x - 1, y = pos.y, z = pos.z}, 
        {x = pos.x, y = pos.y - 1, z = pos.z},
        {x = pos.x + 1, y = pos.y, z = pos.z}, 
        {x = pos.x, y = pos.y + 1, z = pos.z}
 }
 local To = {2, 3, 4, 1, 6, 7, 8, 5}
 repeat
        for i = 1, (#From / 2) do
        local to, f = From[To[i]], (C % 2 == 1) and true or false
        doSendDistanceShoot(pos, to, CONST_ANI_FIRE)
        if f then doAreaCombatHealth(x.uid, COMBAT_FIREDAMAGE, to, 0, -200, -dmg, CONST_ME_EXPLOSIONAREA) end
        i = i + (#From / 2)
        local to = From[To[i]]
        doSendDistanceShoot(pos, to, CONST_ANI_FIRE)
        if f then doAreaCombatHealth(x.uid, COMBAT_FIREDAMAGE, to, 0, -1, -200, CONST_ME_EXPLOSIONAREA) end
        end
        C = C + 1
 until C == 10
end 

function onUse(cid, item, frompos, item2, topos) 

 local pos = {x = getThingPos(item.uid).x, y = getThingPos(item.uid).y, z = getThingPos(item.uid).z}
 
		doPlayerSendTextMessage(cid,22, pos.x .. ', '.. pos.y .. ', '.. pos.z)
		
        addEvent(bomb, 1000, {x = item, pos = pos})
		
  return TRUE
end

How it's supposed to work: You use an item to put the bomb, after x sec it will explode in the area of where it was put, obvious bomberman is obvious :p

But i can't even make the explosion work, let alone the barrels removals
 
should I release it?

I got a very basic script working, this includes placing bomb & taking out barrels (configurable) and a script that prevents player from walking diagonally
 
Lua
Code:
function onStepIn(cid, item, pos, fromPos)
	if math.abs(pos.x - fromPos.x) == math.abs(pos.y - fromPos.y) then
		if item.actionid == 100 then
			doItemSetAttribute(item.uid, "aid", 0)
		else
			doItemSetAttribute(getTileItemById(fromPos, 10764).uid, "aid", 100)
			doTeleportThing(cid, fromPos, false)
		end
	end
end
:)

Oo, nice one, didn't know that was possible :p

Btw, can you share the script you made? Since you're alot better than me I'd like to see how you made it so I can learn from it :p
 
Well, it's very basic and it sucks (I made it in a hurry):
Code:
local t = {
	from = {x=490, y=495, z=7},
	to = {x=504, y=505, z=7},
	storage = {
		placed = 10001,
		max = 10002,
		radius = 10003
	},
	delay = 3000,
	bombID = 10507, -- 10570 ?
	effect = CONST_ME_MORTAREA,
	blockID = 9468,
	text = "BOOM!"
}
local function boom(pos, cid)
	local v = getTileItemById(pos, t.bombID).uid
	if isPlayer(cid) then
		setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) - 1)
		doCreatureSay(cid, t.text, TALKTYPE_ORANGE_2, false, nil, pos)
		doSendMagicEffect(pos, CONST_ME_ENERGYAREA)
		local b = getTileItemById(pos, t.blockID).uid
		if b > 0 then
			doRemoveItem(b)
		end
		local N, E, W, S, l = 1, 1, 1, 1, getPlayerStorageValue(cid, t.storage.radius)
		function loopDir(dir)
			local _pos = {x=pos.x+(dir=="E" and E or dir=="W" and -W or 0), y=pos.y+(dir=="N" and -N or dir=="S" and S or 0), z=pos.z}
			if queryTileAddThing(v, _pos, 4) == RETURNVALUE_NOERROR or getTileItemById(_pos, t.blockID).uid > 0 then
				doSendMagicEffect(_pos, t.effect)
				local b = getTileItemById(_pos, t.blockID).uid
				if b > 0 then
					doSendMagicEffect(_pos, CONST_ME_BLOCKHIT)
					doRemoveItem(b)
					return false
				end
			end
			return true
		end
		while N <= l do
			if loopDir("N") then
				N = N + 1
			else
				break
			end
		end
		while E <= l do
			if loopDir("E") then
				E = E + 1
			else
				break
			end
		end
		while W <= l do
			if loopDir("W") then
				W = W + 1
			else
				break
			end
		end
		while S <= l do
			if loopDir("S") then
				S = S + 1
			else
				break
			end
		end
	end
	doRemoveItem(v)
end
function onSay(cid, words, param, channel)
	if isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, math.max(getPlayerStorageValue(cid, t.storage.placed), 0))
		setPlayerStorageValue(cid, t.storage.max, math.max(getPlayerStorageValue(cid, t.storage.max), 1))
		setPlayerStorageValue(cid, t.storage.radius, math.max(getPlayerStorageValue(cid, t.storage.radius), 1))
		if getPlayerStorageValue(cid, t.storage.placed) < getPlayerStorageValue(cid, t.storage.max) then
			doCreateItem(t.bombID, 1, getThingPos(cid))
			addEvent(boom, t.delay, getThingPos(cid), cid)
			setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) + 1)
		end
		return true
	end
end
Yea, it's work in progress.
 
Back
Top