• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Reputation for killing monsters, players.

@Edit [***2***]

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
(Not tested all bugs please reports!)

@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
(Not tested all bugs please reports!)


-- 2 post --
 
well it's not bad at all
if you don't mind I'll take your php script for my rep system
 
It would be nice as well, if the opponent is not on any type of skull(without skull):

Code:
You killed the "..playerWithoutSkull.." and lost "..math.random(10, 20).." points of reputation.
 
HOW ADD script every 15 minutes broadcast.

TOP POINTER:
1) XXX
2) XXX
3) XXX
4) XXX
5) XXX

REPUTATION FOR PLAYER WHO GIVE ME THIS SCRIPT !
 
HOW ADD script every 15 minutes broadcast.

TOP POINTER:
1) XXX
2) XXX
3) XXX
4) XXX
5) XXX

REPUTATION FOR PLAYER WHO GIVE ME THIS SCRIPT !
:blink: hard one
wait...
 
Still Need!TOp list in accmaker reputation (highscores)? or in game
TOP POINTERS ONLINE:
1) xxx
2) xxx
3) xxx
 
Back
Top