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

CreatureEvent Cats should have 7 lifes :D

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,152
Solutions
12
Reaction score
1,107
Location
Germany :O
Welcome :D

Here is my scripts so cats die after 7 kills and not after 1.
Code:
<event type="kill" name="Cats" event="script" value="cat.lua"/>
-> In creaturescripts.xml

Create cat.lua in creaturescripts/scripts..
-> Add this:
Code:
function onKill(cid, target)
local config = {
monstername = "Cat",
text = "The cat lost her 7 lifes! :D"
}

if getCreatureName(target) == config.monstername then
	local catuid = getGlobalStorageValue(tonumber(target))
	if catuid >= 5 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.text)
		return TRUE
	else
		setGlobalStorageValue(tonumber(target),(catuid+1))
		local maxhealth = getCreatureMaxHealth(target)
		doCreatureAddHealth(target, maxhealth,1)
		doSendMagicEffect(getCreaturePosition(target),49)
		doSendAnimatedText(getCreaturePosition(target),maxhealth,120)
		return FALSE
	end
else
	return TRUE
end
end

Hope you like it :D
Another example if you want an monster that can't die (it revives when killed). Can be used for trainers:
Code:
function onKill(cid, target)
local config = {
monstername = "Trainer",
text = "You can't kill trainers :D"
}
	if getCreatureName(target) == config.monstername then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.text)
		local maxhealth = getCreatureMaxHealth(target)
		doCreatureAddHealth(target, maxhealth,1)
		doSendMagicEffect(getCreaturePosition(target),49)
		doSendAnimatedText(getCreaturePosition(target),maxhealth,120)
		return FALSE
	end
	return TRUE
end

-> monstername is just the name of the creature and text is the text which is shown when the cat (first script) dies and in second script when you kill the monster and it revives.

REP++ if you like it :p
 
Funny idea, but it should be 9 :wub:
 
Why the smiley face after "The cat lost her 7 lifes!"? I mean, who the heck in the world would be happy after killing such a kind and cute animal?

Ok, it was a joke, nice script.
 
no man!! you house cost only 2000£ my bomb cost 20000£ is waste!!!

only bomb paris hilton house cost 450000£
 
Back
Top