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

Claymore script!! Awesome script

wafuboe

Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
24
I need a claymore script something like this
YouTube - armada azteca claymores

im searching it but i dont find it ;S

then i need a White skull remover rune with this your white skull is removed only white skull not frag!


thanks
plzz i need these scripts there are pretty awesome :D
 
maybe when you press on the item, it converts to an invisible tile, and when you step on that invisible tile, it removes all your hp, and shows a magic effect

as invisible tile you could use 460.
 
It doesn't look really tough, or I'm wrong heh.
Well I'm pretty sure this should work
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
doRemoveItem(item.uid, 1)
doSendMagicEffect(fromPosition, CONST_ME_FIREAREA)
doSendAnimatedText(fromPosition, 'Activated', 180)
doSetItemAttribute(fromPosition, 'aid', 300)
return true
end

Then just, make a StepIn that if you stepIn AID 300 you get hitted by 'x' hp and that's it.

EDIT: Oh, probably some ehm, checkings to check if its pz or something?
 
It doesn't look really tough, or I'm wrong heh.
Well I'm pretty sure this should work
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
doRemoveItem(item.uid, 1)
doSendMagicEffect(fromPosition, CONST_ME_FIREAREA)
doSendAnimatedText(fromPosition, 'Activated', 180)
doSetItemAttribute(getThingFromPos(fromPosition).uid, 'aid', 300)
return true
end

Then just, make a StepIn that if you stepIn AID 300 you get hitted by 'x' hp and that's it.

EDIT: Oh, probably some ehm, checkings to check if its pz or something?

nice and simple :p you only forgot getThingFromPos()
Look at this, Proximity Bomb:
Lua:
local area = {
	{0,0,0,0,0,0,0},
	{0,0,1,1,1,0,0},
	{0,1,1,1,1,1,0},
	{0,1,1,1,1,1,0},
	{0,1,1,1,1,1,0},
	{0,0,1,1,1,0,0},
	{0,0,0,0,0,0,0}
	}
function explodeOnRange(cid, Pos, delay)
local target = {}	
	for x = Pos.x-3, Pos.x+3 do
		for y = Pos.y-3, Pos.y+3 do
			local eid = getThingFromPos({x = x, y = y, Pos.z, stackpos = STACKPOS_TOP_CREATURE}).uid
			table.insert(target, eid)
			if target ~= cid and isCreature(target) then
				doSendAnimatedText(Pos, 'CLICK', 125)
				addEvent(doAreaCombatHealth, delay*1000, cid, COMBAT_FIREDAMAGE, Pos, area, -50, -100, 36) -- till I make a formula
			else
				addEvent(explodeOnRange, 500, cid, Pos, delay)
			end
		end
	end
end
	
function onUse(cid, item, fromPos, itemEx, toPos)
	addEvent(explodeOnRange, 500, cid, fromPos, 1)
	return doRemoveItem(item.uid, 1) and true
end

It's untested and I need to build a formula for it.
It will not blow up if the person who put it is in range only other creatures.
 
Last edited:
ahhh ok D;
Added a simple formula:
Lua:
local area = {
	{0,0,0,0,0,0,0},
	{0,0,1,1,1,0,0},
	{0,1,1,1,1,1,0},
	{0,1,1,1,1,1,0},
	{0,1,1,1,1,1,0},
	{0,0,1,1,1,0,0},
	{0,0,0,0,0,0,0}
	}
function getFormula(cid, type)
	local formula = 0
	if type == min then
		formula = math.floor(getCreatureLevel(cid)^2.5*0.25)
	elseif type == max then
		formula = math.floor(getCreatureLevel(cid)^2.5*0.5)
	end	
return formula
end	
function explodeOnRange(cid, Pos, delay)
local target = {}	
	for x = Pos.x-3, Pos.x+3 do
		for y = Pos.y-3, Pos.y+3 do
			local eid = getThingFromPos({x = x, y = y, Pos.z, stackpos = STACKPOS_TOP_CREATURE}).uid
			table.insert(target, eid)
			if target ~= cid and isCreature(target) then
				doSendAnimatedText(Pos, 'CLICK', 125)
				addEvent(doAreaCombatHealth, delay*1000, cid, COMBAT_FIREDAMAGE, Pos, area, -getFormula(cid, min), -getFormula(cid, max), 36)
			else
				addEvent(explodeOnRange, 500, cid, Pos, delay)
			end
		end
	end
end
	
function onUse(cid, item, fromPos, itemEx, toPos)
	addEvent(explodeOnRange, 500, cid, fromPos, 1.5)
	return doRemoveItem(item.uid, 1) and true
end

Can someone test this?
 
Well i tried something with my noob skillz maybe you guys can make something of it;d

In data/actions.xml:
Code:
	<action itemid="2151" event="script" value="other/mijn2.lua"/>
In Data/Movements.xml:
Code:
	<movevent type="Stepin" itemid="460" event="script" value="mijn.lua"/>
Code:
In data/actions/other/mijn2.lua:
function onUse(cid, item, fromPos, itemEx, toPos)
local playerPos = getCreaturePosition(cid)
doTransformItem(item.uid, item.itemid == 460 or 460)
doSendAnimatedText(playerPos, 'CLICK', 125)
end
In data/movements/scripts/mijn.lua:
Code:
local area = {
	{0,0,0,0,0,0,0},
	{0,0,1,1,1,0,0},
	{0,1,1,1,1,1,0},
	{0,1,1,1,1,1,0},
	{0,1,1,1,1,1,0},
	{0,0,1,1,1,0,0},
	{0,0,0,0,0,0,0}
	}
function onStepIn(cid, item, pos)
doSendMagicEffect(area, CONST_ME_SPARKLE)
end

Doesnt work i know;d
 
Well i tried something with my noob skillz maybe you guys can make something of it;d

In data/actions.xml:
Code:
	<action itemid="2151" event="script" value="other/mijn2.lua"/>
In Data/Movements.xml:
Code:
	<movevent type="Stepin" itemid="460" event="script" value="mijn.lua"/>
Code:
In data/actions/other/mijn2.lua:
function onUse(cid, item, fromPos, itemEx, toPos)
local playerPos = getCreaturePosition(cid)
doTransformItem(item.uid, item.itemid == 460 or 460)
doSendAnimatedText(playerPos, 'CLICK', 125)
end
In data/movements/scripts/mijn.lua:
Code:
local area = {
	{0,0,0,0,0,0,0},
	{0,0,1,1,1,0,0},
	{0,1,1,1,1,1,0},
	{0,1,1,1,1,1,0},
	{0,1,1,1,1,1,0},
	{0,0,1,1,1,0,0},
	{0,0,0,0,0,0,0}
	}
function onStepIn(cid, item, pos)
doSendMagicEffect(area, CONST_ME_SPARKLE)
end

Doesnt work i know;d

my script doesn't need a movements script
i leaves a looped event to check who is in range, it will not blow up on the user that put it only on other creatures
 
here is one i find however error in console
[24/03/2011 15:44:23] [Error - Action Interface]
[24/03/2011 15:44:23] data/actions/scripts/claymore.lua:eek:nUse
[24/03/2011 15:44:23] Description:
[24/03/2011 15:44:23] (luaGetThingPosition) Thing not found

[24/03/2011 15:44:23] [Error - Action Interface]
[24/03/2011 15:44:23] data/actions/scripts/claymore.lua:eek:nUse
[24/03/2011 15:44:23] Description:
[24/03/2011 15:44:23] (luaDoItemSetAttribute) Item not found


Action
function isWalkable(pos, creature, proj, pz)-- by Nord
if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
if getTopCreature(pos).uid > 0 and creature then return false end
if getTileInfo(pos).protection and pz then return false, true end
local n = not proj and 3 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isCreature(itemEx.uid) or not isWalkable(getThingPos(itemEx.uid)) then
doPlayerSendCancel(cid, "You cannot plant a claymore here.")
return true
end
doPlayerSendTextMessage(cid, 22, "Activated!.")
doRemoveItem(item.uid)
doSendMagicEffect(getThingPos(itemEx.uid), 5)
doItemSetAttribute(itemEx.uid, "aid", 8888)
return true
end

<movevent type="StepIn" actionid="8888" event="script" value="claymore.lua"/>




movevent

function onStepIn(cid, item, frompos, itemEx, topos)
frompos = p
local pos = {
{x = p.x-1, y = p.y, z = p.z},
{x = p.x+1, y = p.y, z = p.z},
{x = p.x, y = p.y+1, z = p.z},
{x = p.x, y = p.y-1, z = p.z}
}
doItemSetAttribute(item.uid, "aid", 0)
for i = 1,4 do
doSendMagicEffect(pos, math.random(1,5))
end
doPlayerSendTextMessage(cid, "Tick")
doCreatureAddHealth(cid, math.random(20000, 5000))
return true
end


if someone can modified it and put some explosion it will be great :D
 
Yes but your script give's erorrs look up;d
getThingFromPos(pos, false) << no more errors, it returns an error because there is nothing there or that Top Creature does not work properly.
Also if you do not have enough memory it will cause a lot of usage of memory in which will cause the server to crash. I wish this proximity bomb would work without causing crash.
 

Similar threads

Back
Top