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

Monster onStatsChange

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello
I need an simple creaturescript onStatsChange:

I need simple script that allows monster to transform to another one,

example: If i "kill monster" the monster transformating to another one and heals the health to maximum.

Anyone get that ?
 
Why onStatsChange()?

LUA:
function onKill(cid, target, lastHit)
	if(isMosnter(target) and getCreatureName(target) == "MONSTERNAME") then
		doSummonCreature("MONSTERNAME", getCreaturePosition(target))
	end
	return true
end
 
Spelling: isMonster(target)

-----

I would use this script, so people cannot kill summons.

LUA:
local config = {
	["dog"] = "cat"
}

function onKill(cid, target, lastHit)
	local t = config[getCreatureName(target):lower()]
	if t then
		local master = getCreatureMaster(target)
		if master and master ~= target then return true end
		
		if isMonster(target) then
			for _, p in pairs(config) do
				doSummonCreature(p, getCreaturePosition(target))
			end
		end
	end
	
	return true
end

Yeah my bad with spelling.

Shortened a bit:
LUA:
local config = {
	["dog"] = "cat"
}

function function onKill(cid, target, lastHit)
	if(config[string.lower(getCreatureName(target))] and isMonster(target) and getCreatureMaster(target) ~= target) then
		doSummonCreature(config[string.lower(getCreatureName(target))], getCreaturePosition(target))
	end
	return true
end
 
Back
Top