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

Scipt so people dont die in a certain area?

gilbert123

~Caspin~
Joined
Mar 11, 2011
Messages
98
Reaction score
1
Hey! I am making an even with a Monster that will kill everyone in one hit, and the last person alive wins a prize.
However, I can not figure out how to make it so that when the people are hit and killed, they do NOT loose levels!
Any suggestions or scripts?
Thanks!
 
That is easy..
LUA:
local c = {
	campFrom = {x = 32310, y = 31891, z = 7},
	campTo = {x = 32346, y = 31967, z = 7},	
	newPos = {x = 32369, y = 32241, z = 7}
}
function onStatsChange(cid, attacker, type, combat, value)	
	if(isInRange(getThingPos(cid), c.campFrom, c.campTo)) then
		if (type == STATSCHANGE_HEALTHLOSS) then
			if getCreatureHealth(cid) <= value then				
				doTeleportThing(cid, c.newPos)
				doCreatureAddHealth(cid, getCreatureMaxHealth(cid))				
				return false
			end
		end
	end
	return true
end

Do not forget to edit the config in script, also to add it to login.lua and creaturescripts.xml..
 
Will it work like PVP Arena?
LUA:
local c = {
	campFrom = {x = 32310, y = 31891, z = 7},
	campTo = {x = 32346, y = 31967, z = 7},	
	newPos = {x = 32369, y = 32241, z = 7}
}
function onStatsChange(cid, attacker, type, combat, value)	
	if(isInRange(getThingPos(cid), c.campFrom, c.campTo)) then
		if (type == STATSCHANGE_HEALTHLOSS) then
			if getCreatureHealth(cid) <= value then				
				doTeleportThing(cid, c.newPos)
				doCreatureAddHealth(cid, getCreatureMaxHealth(cid))				
				return false
			end
		end
	end
	return true
end
 
Back
Top