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

need a script that..

erikalabama

New Member
Joined
Jan 5, 2008
Messages
27
Reaction score
0
I need a script that gives u 1000 exp if u kill a player that is paladin, or a script that gives u 1000 exp if u kill a player with citizen outfit(wich
 
Well here i made the script, it only only gives you experience if you kill a Paladin... i tried to make what u said about Citizen outfit but function isnt working(to me) :S

PHP:
function onPrepareDeath(cid, killer)
    onKill(killer, cid)
	return TRUE
end 

local voc = getPlayerVocation(target)
local exp = 1000 --EDIT, Amount of exp given...

function onKill(cid, target)
	if isPlayer(cid) == TRUE then
		if voc == 3 or voc == 7 then
			doPlayerAddExp(cid, 1000)
			doPlayerSendTextMessage(cid, 22, "You killed "..getCreatureName(target).." and received 1,000 experience!.")
        end
    end
	return TRUE
end

PHP:
<event type="preparedeath" name="Killed" script="kill.lua"/>
 
Try this =D

Code:
[COLOR="Blue"][COLOR="DarkGreen"]function[/COLOR] onPrepareDeath[COLOR="DarkGreen"]([/COLOR]cid[COLOR="DarkGreen"],[/COLOR] killer[COLOR="DarkGreen"])[/COLOR]
    onKill[COLOR="DarkGreen"]([/COLOR]killer[COLOR="DarkGreen"],[/COLOR] cid[COLOR="DarkGreen"])[/COLOR]
    [COLOR="DarkGreen"]return[/COLOR] TRUE
end 

local playerOutfit [COLOR="DarkGreen"]=[/COLOR] getCreatureOutfit[COLOR="DarkGreen"]([/COLOR]target[COLOR="DarkGreen"])[/COLOR]
local outfits [COLOR="DarkGreen"]=[/COLOR] [COLOR="DarkGreen"]{[/COLOR]128[COLOR="DarkGreen"],[/COLOR] 136[COLOR="DarkGreen"]}[/COLOR]
local exp [COLOR="DarkGreen"]=[/COLOR] 1000

[COLOR="DarkGreen"]function[/COLOR] onKill[COLOR="DarkGreen"]([/COLOR]cid[COLOR="DarkGreen"],[/COLOR] target[COLOR="DarkGreen"])[/COLOR]
    [COLOR="DarkGreen"]if[/COLOR] isPlayer[COLOR="DarkGreen"]([/COLOR]cid[COLOR="DarkGreen"])[/COLOR] [COLOR="DarkGreen"]==[/COLOR] TRUE [COLOR="DarkGreen"]then[/COLOR]
        [COLOR="DarkGreen"]if[/COLOR] isPaladin[COLOR="DarkGreen"]([/COLOR]target[COLOR="DarkGreen"])[/COLOR] [COLOR="DarkGreen"]or[/COLOR] playerOutfit [COLOR="DarkGreen"]==[/COLOR] outfits [COLOR="DarkGreen"]then[/COLOR]
            doPlayerAddExp[COLOR="DarkGreen"]([/COLOR]cid[COLOR="DarkGreen"],[/COLOR] exp[COLOR="DarkGreen"])[/COLOR]
            doPlayerSendTextMessage[COLOR="DarkGreen"]([/COLOR]cid[COLOR="DarkGreen"],[/COLOR] 22[COLOR="DarkGreen"],[/COLOR] [COLOR="Red"]"You killed[/COLOR] "..getCreatureName[COLOR="DarkGreen"]([/COLOR]target[COLOR="DarkGreen"])[/COLOR].." [COLOR="Red"]and received[/COLOR] " .. exp .. " [COLOR="Red"]experience points."[/COLOR][COLOR="DarkGreen"])[/COLOR]
        end
    end
    [COLOR="DarkGreen"]return[/COLOR] TRUE
end[/COLOR]
 
Last edited:
@Up

Im telling that getCreatureOutfit is not working that way...

luaGetCreatureOutfit(). Creature not found

Look the source...

setField(L, "lookType", outfit.lookType);
setField(L, "lookHead", outfit.lookHead);
setField(L, "lookBody", outfit.lookBody);
setField(L, "lookLegs", outfit.lookLegs);
setField(L, "lookFeet", outfit.lookFeet);
setField(L, "lookAddons", outfit.lookAddons);

Its not taking only the lookType its everything!
 
Well here i made the script, it only only gives you experience if you kill a Paladin... i tried to make what u said about Citizen outfit but function isnt working(to me) :S

PHP:
function onPrepareDeath(cid, killer)
    onKill(killer, cid)
	return TRUE
end 

local voc = getPlayerVocation(target)
local exp = 1000 --EDIT, Amount of exp given...

function onKill(cid, target)
	if isPlayer(cid) == TRUE then
		if voc == 3 or voc == 7 then
			doPlayerAddExp(cid, 1000)
			doPlayerSendTextMessage(cid, 22, "You killed "..getCreatureName(target).." and received 1,000 experience!.")
        end
    end
	return TRUE
end

PHP:
<event type="preparedeath" name="Killed" script="kill.lua"/>

man it dosen't work, when I kill a pally I get banned :S
 
Try this, edited darkhaos script and function taken by Rudolf.

PHP:
function onPrepareDeath(cid, killer)
    onKill(killer, cid)
    return TRUE
end 

local exp = 1000

function onKill(cid, target)
    if isPlayer(cid) == TRUE then
        if isPaladin(target) or getCreatureOutfit(target).lookType == citizen# then
            doPlayerAddExp(cid, exp)
            doPlayerSendTextMessage(cid, 22, "You killed "..getCreatureName(target).." and received " .. exp .. " experience points.")
        end
    end
    return TRUE
end
 
@Up

its not citizen# you must change the ID of the looktype.. :D

Now its working perfect:

PHP:
local exp = 1000 --EDIT, Amount of exp given...
local outfits = {128, 136} 	 

function onKill(cid, target)
    if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
        local voc = getPlayerVocation(target)
        local outfit = getCreatureOutfit(target)
        if voc == 3 or voc == 7 or isInArray(outfits, outfit.lookType) == TRUE then
            doPlayerAddExp(cid, exp)
            doPlayerSendTextMessage(cid, 22, "You killed "..getCreatureName(target).." and received "..exp.." experience!.")
        end
    end
    return TRUE
end

In creaturescripts.xml

PHP:
<event type="kill" name="PlayerKill" script="kill.lua"/

In login.lua above function onLogin(cid) add this line:

PHP:
registerCreatureEvent(cid, "PlayerKill")

Thanks to:
Nahruto -- For helping me with the registerEvent
Rudolf Czarodziej -- For giving the function of getCreatureOutfit correctly
 
Last edited:
Code:
local exp = 1000 --EDIT, Amount of exp given...
local outfits = {128, 136}      

function onKill(cid, target)
    if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
        local voc = getPlayerVocation(target)
        local outfit = getCreatureOutfit(target)
        for x = (3, 7) do
        if voc == x or isInArray(outfits, outfit.lookType) == TRUE then
            doPlayerAddExp(cid, exp)
            doPlayerSendTextMessage(cid, 22, "You killed "..getCreatureName(target).." and received "..exp.." experience!.")
        end
    end
    return TRUE
end
 
Last edited:
Back
Top