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

Throw item on tile/walk on tile then...

Mc-Pedro

Banned User
Joined
Sep 9, 2007
Messages
748
Reaction score
0
Location
Sweden
I need a script so when you walk on a tile or throw an item on a tile it will play effect energy and the item will dissapear and if a person steps on it, it will play effect energy and the player will be hurt for 300 damage.


Thanks, Mc-Pedro.
 
There you go, i tested this on an evo server but it should work on most servers with movements fuctions...If you have any problem just send me a pm

first create a new file in this folder: data/movements/scripts/>here< called for example request.lua,(it has to end in ".lua")

now inside that copy this:

Code:
function onStepIn(cid, item, pos)
	if isPlayer(cid) == 1 then
		doPlayerAddHealth(cid,-300)
		doSendAnimatedText(pos,300,0)
		doSendMagicEffect(pos,11)
	end
end
function onAddItem(moveitem, tileitem, pos)
	if moveitem.type > 1 then
	doRemoveItem(moveitem.uid, moveitem.type)
	doSendMagicEffect(pos,11)
	else
	doRemoveItem(moveitem.uid, 1)
	doSendMagicEffect(pos,11)
	end
end

inside data/movements/movements.xml
add this:
Code:
<movevent event="StepIn" actionid="[COLOR="Red"]8888[/COLOR]" script="request.lua" />
<movevent event="AddItem" tileitem="1" actionid="[COLOR="Red"]8888[/COLOR]" script="[COLOR="Red"]request.lua[/COLOR]" />
somewhere between:
Code:
<?xml version="1.0"?>
<movements>
and:
Code:
</movements>
oh u can also change the red parts to fit ur needs (change request.lua to ur file's name and 8888 to the action id you want to use (also if want to use an itemid just change actionid for itemid and 8888 to the tile thats supossed to do this))

hope you get what i just wrote :p
 
Last edited:
Back
Top