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

3li Xiber

Active Member
Joined
Dec 29, 2014
Messages
395
Reaction score
31
Now I Have This Script
Code:
function onKill(cid, target, lastHit)
local rewardItem = {
6527, --ITEM ID!
1 -- How many?
}

if isPlayer(cid) and isPlayer(target) then
if getPlayerIp(cid) ~= getPlayerIp(target) then
doPlayerAddItem(cid, rewardItem[1], rewardItem[2])
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
]



But When I Kill Other Char I don't Get Reward Or Error ....

BUMP !!

@Limos

I Use Version 0.3.6 Can u help me Bro ?
 
Last edited by a moderator:
@Mera Mero has that worked ?
no still same thing :S i got bored from it >.<
Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getPlayerName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
return true
end

if(getStor == 5) then
doBroadcastMessage("".. name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage("".. name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage("".. name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage("".. name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
 
Well you maybe need myhelp cuz its my script Q_Q

Here you are the setting of script-:
<event type="kill" name="lekor" event="script" value="fragreward.lua"/>

login.lua
registerCreatureEvent(cid, "lekor")

the script maybe work ;)

Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 2},
{"Owned!", 18, 3},
{"Pwnt!", 215, 4}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
     return true
end

if(getStor == 5) then
doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage(name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage(name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
 
Well you maybe need myhelp cuz its my script Q_Q

Here you are the setting of script-:
<event type="kill" name="lekor" event="script" value="fragreward.lua"/>

login.lua
registerCreatureEvent(cid, "lekor")

the script maybe work ;)

Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 2},
{"Owned!", 18, 3},
{"Pwnt!", 215, 4}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
     return true
end

if(getStor == 5) then
doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage(name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage(name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
shh nothing worked but its ok i wont use it i'll search about another one ;D
 
Explain what the problem is, people have to know what the problem is to be able to help.
If you don't know what the problem is, people are also not able to help because they don't know what to solve.

So explain what it's supposed to do, what it's not doing and what should be different.
If it doesn't do anything (like it's not loaded/used at all) you can add print under the main function to see if you get this message in your console after using the script.
Code:
print("script load test.")
If you get this message in your console, it means the script is added correct, so there is something else wrong.
Next thing you can do it add it under if statements and see which message you are not getting to find out which if statement is not true.
 
no still same thing :S i got bored from it >.<
Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
return true
end

if(getStor == 5) then
doBroadcastMessage("".. getPlayerName(cid) .." is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage("".. getPlayerName(cid) .." is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage("".. getPlayerName(cid) .." is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage("".. getPlayerName(cid) .." is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god ".. getPlayerName(cid) .." has 100 frags!")
end

return true
end
@Mera Mero try
Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
return true
end

if(getStor == 5) then
doBroadcastMessage("".. getPlayerName(cid) .." is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage("".. getPlayerName(cid) .." is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage("".. getPlayerName(cid) .." is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage("".. getPlayerName(cid) .." is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god ".. getPlayerName(cid) .." has 100 frags!")
end

return true
end
 
Explain what the problem is, people have to know what the problem is to be able to help.
If you don't know what the problem is, people are also not able to help because they don't know what to solve.

So explain what it's supposed to do, what it's not doing and what should be different.
If it doesn't do anything (like it's not loaded/used at all) you can add print under the main function to see if you get this message in your console after using the script.
Code:
print("script load test.")
If you get this message in your console, it means the script is added correct, so there is something else wrong.
Next thing you can do it add it under if statements and see which message you are not getting to find out which if statement is not true.
[29/01/2015 23:26:09] >> Loading script systems
[29/01/2015 23:26:10] script load test.
[29/01/2015 23:26:11] >> Loading chat channels
 
Ok, so the script is loading, which means you added it correct, so explain what it wrong, what happens, what should be different etc.
 
@Limos @Natala Ots Problem Solved. I was Got Battle Team Event Mod And It make Crash To My Movements Files and other files It caused : Frag Reward Script Wasn't Work - Donate Boots And Other Donates Wasn't Give Hp/Mana When I Log in

I Solved it :p
 
@Mera Mero try
Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
return true
end

if(getStor == 5) then
doBroadcastMessage("".. getPlayerName(cid) .." is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage("".. getPlayerName(cid) .." is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage("".. getPlayerName(cid) .." is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage("".. getPlayerName(cid) .." is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god ".. getPlayerName(cid) .." has 100 frags!")
end

return true
end
doesn't working mmm np i dont need it anymore
 
Back
Top