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
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
<event type="preparedeath" name="Killed" script="kill.lua"/>
[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]
luaGetCreatureOutfit(). Creature not found
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);
if getCreatureOutfit(target).lookType == citizen# then
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"/>
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
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
<event type="kill" name="PlayerKill" script="kill.lua"/
registerCreatureEvent(cid, "PlayerKill")
compare number with table?
or outfit.lookType == outfits then
PHP:outfit.lookType == outfits[1] or outfit.lookType == outfits[2] = isInArray(outfits, outfit.lookType)
Nah ^^ it could be color or anything noobak
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