pirl0
Scripter
- Joined
- Apr 16, 2009
- Messages
- 172
- Reaction score
- 0
@Edit [***2***]
Version only for players :
(Not tested all bugs please reports!)
@Edit [***3***]
Version for custom monsters :
(Not tested all bugs please reports!)
-- 2 post --
Version only for players :
Lua:
function onKill(cid, target)
-- Config --
local storage = 666 -- Storage value of the script.
local script =
{
name = getCreatureName(target), -- Do not edit.
how_check = getPlayerStorageValue(cid,999), -- Do not edit.
killed = getPlayerStorageValue(cid,storage), -- Do not edit.
skull_check = getCreatureSkullType(target) -- Do not edit.
}
local players =
{
[0] = {points = 5, msg= "You have kill ".. getPlayerName(target) .." and you gained ".. players[0].points .." reputation point."}, --[Skull Type] = Points / MSG
[3] = {points = 5, msg= "You have kill ".. getPlayerName(target) .." and you gained ".. players[3].points .." reputation point."},
[4] = {points = 5, msg= "You have kill ".. getPlayerName(target) .." and you gained ".. players[4].points .." reputation point."},
[5] = {points = 5, msg= "You have kill ".. getPlayerName(target) .." and you gained ".. players[5].points .." reputation point."}
}
local skull = script.skull_check
local points = players[skull].points
local msg = players[skull].msg
-- Script --
if(isPlayer(target) == TRUE) then
setPlayerStorageValue(cid, storage,script.killed + points)
doPlayerSendTextMessage(cid,22,msg)
return TRUE
end
end
@Edit [***3***]
Version for custom monsters :
Lua:
function onKill(cid, target)
-- Config --
local storage = 666 -- Storage value of the script.
local script =
{
name = getCreatureName(target), -- Do not edit.
how_check = getPlayerStorageValue(cid,999), -- Do not edit.
killed = getPlayerStorageValue(cid,storage), -- Do not edit.
skull_check = getCreatureSkullType(target) -- Do not edit.
}
local monsters =
{
["Rat"] = {points = 1},
["Demon"] = {points = 5},
["Ferumbras"] = {points = 100},
}
local points = monsters[script.name].points
local pointss = script.killed + points
local msg = "You have now ".. pointss .." points."
local msg_monster = "You have slain ".. script.name .." and you get ".. points .." reputation point." -- Standard message for killing monster you can edit this.
local tbl = monsters[script.name]
-- Script --
if(not tbl) then
return TRUE
end
if(tbl) then
setPlayerStorageValue(cid, storage,script.killed + points)
doPlayerSendTextMessage(cid,22,msg_monster)
doPlayerSendTextMessage(cid,23,msg)
return TRUE
end
return TRUE
end
-- 2 post --