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

Lua YALAHARIGHOST effect on death

Szafi

www.rookwar.pl
Joined
Mar 2, 2009
Messages
165
Reaction score
10
Location
Poland
Hello i search more script and all script is now worked on my TFS 0.4 :/
http://otland.net/search/684445/?q=Effect+on+Death&o=relevance&c[node]=132

Add to login lua:
Code:
registerCreatureEvent(cid, "own3d")

Add to creaturescript.xml
Code:
<event type="kill" name="own3d" script="own3d.lua"/>

own3d.lua

Code:
function onKill(cid, killer)
doSendMagicEffect(getCreaturePosition(killer), CONST_ME_YALAHARIGHOST)
doSendAnimatedText(getCreaturePosition(cid), "Own3d!", math.random(1, 255))
return true
end

Logs is clear, why not working? :/
 
function onKill(cid, target)
doSendMagicEffect(getCreaturePosition(target), CONST_ME_YALAHARIGHOST)
doSendAnimatedText(getCreaturePosition(cid), "Own3d!", math.random(1, 255))
return true
end
 
function onKill(cid, target)
doSendMagicEffect(getCreaturePosition(target), CONST_ME_YALAHARIGHOST)
doSendAnimatedText(getCreaturePosition(cid), "Own3d!", math.random(1, 255))
return true
end

Don't worked, errors in engine 0 :/

@edit!!!!

Don't worked, errors in engine 0 :/
My bad, worked
function onKill(cid, target)
doSendMagicEffect(getCreaturePosition(target), CONST_ME_YALAHARIGHOST)
doSendAnimatedText(getCreaturePosition(cid), "Own3d!", math.random(1, 255))
return true
end

How to text Own3d! and CONST_ME_YALAHARIGHOST viev to all player's? And Text "Own3d!" that was red all the time?
 
Last edited:
Another thing that weird.. What is the math random for?

yes :P

Code:
function onKill(cid, target)
doSendMagicEffect(getCreaturePosition(target), CONST_ME_YALAHARIGHOST)
doSendAnimatedText(getCreaturePosition(target), "Own3d!", TEXTCOLOR_RED)
return true
end

Ok, worked - thanks for "road"
 
Code:
local config = {
    texts = {
        "PWNED!",
        "OWNED",
        "DEAD"
    },
    colors = {
        TEXTCOLOR_RED,
        TEXTCOLOR_BLUE,
        TEXTCOLOR_WHITE
    }
}

function onKill(cid, target)
    if not isPlayer(target) then
        return true
    end

    local targetPosition, random = getCreaturePosition(target), math.random
    doSendMagicEffect(targetPosition, CONST_ME_YALAHARIGHOST)
    doSendAnimatedText(targetPosition, config.texts[random(#config.texts)], config.colors[random(#config.colors)])
    return true
end
 
Code:
local config = {
    texts = {
        "PWNED!",
        "OWNED",
        "DEAD"
    },
    colors = {
        TEXTCOLOR_RED,
        TEXTCOLOR_BLUE,
        TEXTCOLOR_WHITE
    }
}

function onKill(cid, target)
    if not isPlayer(target) then
        return true
    end

    local targetPosition, random = getCreaturePosition(target), math.random
    doSendMagicEffect(targetPosition, CONST_ME_YALAHARIGHOST)
    doSendAnimatedText(targetPosition, config.texts[random(#config.texts)], config.colors[random(#config.colors)])
    return true
end
good one but how can i add to make it appear text on the killer? :D
(owned By name)
 
Back
Top