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

Kill a player and gain 1 platinum coin, rep++ ( kill reward )

Dramix

New Member
Joined
Jun 26, 2009
Messages
289
Reaction score
1
hello, I've been looking and looking for a 0.2 + script that does that when I kill a player, I get 1 platinum coin in my bp, all scripts are getting bugged, so were going to do a post and see if someone could help me with a scripts, rep ++
 
Here it is:
Go to data/creaturescripts/scripts/fragreward.lua
Lua:
function onKill(cid, target, lastHit)
local reward = {
        item = 2152, --ITEM ID!
        count = 1 -- How many?
}
        if(isPlayer(cid) and isPlayer(target)) then
	if getPlayerIp(cid) ~= getPlayerIp(target) then
                doPlayerAddItem(cid, reward.item, reward.count)
else
doPlayerAddExperience(cid, -1000000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
                end
end
return TRUE
end

Now data/creaturescripts/scripts/login.lua
Add this before "return true"
Lua:
	registerCreatureEvent(cid, "FragReward")

Let's finish this: Go to data/creaturescripts/creaturescripts.xml

Lua:
	<event type="kill" name="FragReward" event="script" value="fragreward.lua"/>

Tell me if you have problems.
 
Here it is:
Go to data/creaturescripts/scripts/fragreward.lua
Lua:
function onKill(cid, target, lastHit)
local reward = {
        item = 2152, --ITEM ID!
        count = 1 -- How many?
}
        if(isPlayer(cid) and isPlayer(target)) then
	if getPlayerIp(cid) ~= getPlayerIp(target) then
                doPlayerAddItem(cid, reward.item, reward.count)
else
doPlayerAddExperience(cid, -1000000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
                end
end
return TRUE
end

Now data/creaturescripts/scripts/login.lua
Add this before "return true"
Lua:
	registerCreatureEvent(cid, "FragReward")

Let's finish this: Go to data/creaturescripts/creaturescripts.xml

Lua:
	<event type="kill" name="FragReward" event="script" value="fragreward.lua"/>

Tell me if you have problems.

thx, that work!, rep for you :)
 
with that script, you get the reward if you kill yourself too. http://otland.net/f132/please-fix-frag-reward-script-127235/#post1232633
//
Lua:
function onKill(cid, target, lastHit)
	if cid ~= target and isPlayer(target) then
		if getPlayerIp(cid) == getPlayerIp(target) then
			doPlayerAddExperience(cid, -1000000)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
		else
			local attackerLevel, level = getPlayerLevel(cid), getPlayerLevel(target)
			if level >= math.floor(attackerLevel * 0.5) and level <= math.floor(attackerLevel * 1.5) then
				doPlayerAddItem(cid, 2152, 1)
			end
		end
	end
	return true
end
 
Back
Top