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

OWNED (Preparedeath)

bolero

MikeHere
Joined
Apr 13, 2009
Messages
1,146
Reaction score
12
Location
Venezuela
I want script when one player are in 0 of health send Message in blue
Code:
O W N E D !
Help?:p
 
ServerDirectory/mods/OWNED.xml
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="OWNED" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">
	
	<event type="login" name="OWNEDZ" event="script"><![CDATA[
			registerCreatureEvent(cid, "OWNED")
		return TRUE
	]]></event>
	
	<event type="prepareDeath" name="OWNED" event="script"><![CDATA[
			
			if isPlayer(cid) then
				doPlayerSendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O W N E D !")
			end
		return TRUE
		
	]]></event>
</mod>

Not tested!
Test it and tell me if it worked or not :p
 
Last edited:
ServerDirectory/mods/OWNED.xml
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="OWNED" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">
	
	<event type="login" name="OWNEDZ" event="script"><![CDATA[
		function onLogin(cid)
			registerCreatureEvent(cid, "OWNED")
		return TRUE
		end
	]]></event>
	
	<event type="prepareDeath" name="OWNED" event="script"><![CDATA[
				
		function onPrepareDeath(cid, deathList)	
			
			if isPlayer(cid) then
				doPlayerSendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O W N E D !")
			end
		return TRUE
		end
		
	]]></event>
</mod>

Not tested!
Test it and tell me if it worked or not :p

;S if ur doing it as a mod you dont need "function..." and the "end" ;S
 
Oh, right :P

is it ok now? Like first time using mods:p
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="OWNED" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">
	<event type="login" name="OWNEDZ" event="script"><![CDATA[
		registerCreatureEvent(cid, "OWNED")
		return true
	]]></event>
	<event type="prepareDeath" name="OWNED" event="script"><![CDATA[
		if isPlayer(deathList[1]) or isMonster(deathList[1]) and isPlayer(cid) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O W N E D !")
			local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""
			for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
				killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i])
			end
			doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
		end
		return true
	]]></event>
</mod>

;d;d not sure also
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="OWNED" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">
	<event type="login" name="OWNEDZ" event="script"><![CDATA[
		registerCreatureEvent(cid, "OWNED")
		return true
	]]></event>
	<event type="prepareDeath" name="OWNED" event="script"><![CDATA[
		if isPlayer(deathList[1]) or isMonster(deathList[1]) and isPlayer(cid) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O W N E D !")
			local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""
			for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
				killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i])
			end
			doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
		end
		return true
	]]></event>
</mod>

;d;d not sure also

With this on, you cant die :)

I tested it, and when I went to demons, it gave me 0 hp after all the hits, it said O W N E D!, then went to 1 health, and over and over again.
 
With this on, you cant die :)

I tested it, and when I went to demons, it gave me 0 hp after all the hits, it said O W N E D!, then went to 1 health, and over and over again.
try this 1 ;S
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="OWNED" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">
	<event type="login" name="OWNEDZ" event="script"><![CDATA[
		registerCreatureEvent(cid, "OWNED")
		return true
	]]></event>
	<event type="prepareDeath" name="OWNED" event="script"><![CDATA[
		if isPlayer(deathList[1]) or isMonster(deathList[1]) and isPlayer(cid) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O W N E D !")
			local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""
			for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
				killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i])
			end
			corpse
			doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
		end
		return true
	]]></event>
</mod>
 
Bug :/

21e6br6.jpg
 
try this ;S
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="OWNED" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">
	<event type="login" name="OWNEDZ" event="script"><![CDATA[
		registerCreatureEvent(cid, "OWNED")
		return true
	]]></event>
	<event type="kill" name="OWNED" event="script"><![CDATA[
		if isPlayer(cid) or isMonster(cid) and isPlayer(target) then
			doPlayerSendTextMessage(target, 20, "You got owned.")
		end
		return true
	]]></event>
</mod>
 
I can't see the message... I think by creaturescripts it's more easy to create this script >.<!
Code:
function onKill(cid, target, lastHit)
	if isPlayer(cid) or isMonster(cid) and isPlayer(target) then
		doPlayerSendTextMessage(target, 20, "Owned.")
	end
	return true
end
 
change
Code:
doPlayerSendTextMessage(target, 20, "Owned.")
for
Code:
doCreatureSay(target, "O W N E D!", TALKTYPE_ORANGE_1)
 
LUA:
function onKill(cid, target, lastHit)
	if isPlayer(cid) or isMonster(cid) and isPlayer(target) then
		doSendAnimatedText(cid, target, "OWNED", TEXTCOLOR_PURPLE)
	end
	return true
end

Try this one =p

@OzIcO, im noob at scripting but i think that

doCreatureSay(target, "O W N E D!", TALKTYPE_ORANGE_1)

the guy that died had to be alive to that happens?
cuz a dead body cant say anything xD
 
You might want to have an improved version, don't ya?
creaturescripts/scripts/login.lua
LUA:
registerCreatureEvent(cid, "PWNED")

creaturescripts.xml
LUA:
<event type="preparedeath" name="PWNED" event="script" value="PWNED.lua"/>

creaturescripts/scripts/PWNED.LUA
LUA:
  local function sendLetter(p)
        local pos = p.pos
        local letter = p.letter
        doSendAnimatedText(pos, letter, TEXTCOLOR_BLUE)
end

function onPrepareDeath(cid, deathList)
        local letters = {"O", "W", "N", "E", "D", "!"}
        for i = 1, #letters do
                addEvent(sendLetter, i * 150, {pos = getCreaturePosition(cid), letter = letters[i]})
        end
        return true
end

kkthnzbye
 
Last edited:
Back
Top