• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Step on tile - player loses 90% max mana and health..

kessykins

Intermediate OT User
Joined
Mar 15, 2010
Messages
297
Reaction score
105
Hey,

I'm trying to write a little script for when a player steps on a certain tile but I haven't been able to figure it out x.x.

I'm trying to make it so he/she will lose 90% maxhealth and 90% maxmana when on the tile
What would this kind of script look like?
 
Last edited:
Create script.lua (in movements/script) and paste:
LUA:
local per = 90 -- how much percent player will loss
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if (isPlayer(cid)) then
		doCreatureAddHealth(cid, -(getCreatureMaxHealth(cid) * per / 100))
		doCreatureAddMana(cid, -(getCreatureMaxMana(cid) * per / 100))
	end
end

Then in movements.xml and line:
Code:
<movevent type="StepIn" actionid="[COLOR="red"]yourid[/COLOR]" event="script" value="script.lua"/>

And in map add tile with your actionid
 
I can agree with cykotitan, i actually thought it would temporarily remove 90% of the players MAX mana and health.
Well, thanks for this either way, rep for you.
 
Back
Top