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

Request Globalevent? example kill 200x demon and get automatic reward Rep++

Dramix

New Member
Joined
Jun 26, 2009
Messages
289
Reaction score
1
Hello players!

Hello, i was searching for a script, but i didn't found it!

Example: When you kill 200 demons you will get automatic 4 premium points in your account!

Rep++ for helping

Thank you otlanders!
 
So you mean just premium days like you can also buy with the buypremium talkaction?

creaturescripts.xml
Code:
<event type="kill" name="Demons" event="script" value="killdemons.lua"/>

Add this to login.lua
Code:
registerCreatureEvent(cid, "Demons")

killdemons.lua
Code:
local config = {
    ["demon"] = {amount = 200, storage = 19000}
}

function onKill(cid, target)

    local monster = config[getCreatureName(target):lower()]
    if isPlayer(target) or not monster then
        return true
    end

    setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
    if (getPlayerStorageValue(cid, monster.storage) +1) == monster.amount then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you got 4 extra premium days for killing "..(getPlayerStorageValue(cid, monster.storage)+1).." "..getCreatureName(target).."s.")
        doPlayerAddPremiumDays(cid, 4)
        setPlayerStorageValue(cid, monster.storage, -1)
    end
    return true
end
 
Last edited:
So you mean just premium days like you can also buy with the buypremium talkaction?

creaturescripts.xml
XML:
<event type="kill" name="Demons" event="script" value="killdemons.lua"/>

Add this to login.lua
Lua:
	registerCreatureEvent(cid, "Demons")

killdemons.lua
Lua:
function onKill(cid, target)

local config = {
	["demon"] = {amount = 200, storage = 19000}
}

local monster = config[getCreatureName(target):lower()]
local days = 4

	if(isPlayer(target)) or not monster then
		return true
	end

	if getPlayerStorageValue(cid, monster.storage) >= -1 then		
		setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
	end
	if (getPlayerStorageValue(cid, monster.storage) +1) == monster.amount then
		doPlayerSendTextMessage(cid, 22, "Congratulations, you got "..days.." extra premium days for killing "..(getPlayerStorageValue(cid, monster.storage) +1).." "..getCreatureName(target).."s.")
		doPlayerAddPremiumDays(cid, days)
		setPlayerStorageValue(cid, monster.storage, -1)
	end
	return true
end

ty for trying to help me, but i dont understand, im not good.. :/, can you make a script, that you will get item ( 2282 ) if you killed 200 demons ?, thank you for helping!

- - - Updated - - -

So you mean just premium days like you can also buy with the buypremium talkaction?

creaturescripts.xml
XML:
<event type="kill" name="Demons" event="script" value="killdemons.lua"/>

Add this to login.lua
Lua:
	registerCreatureEvent(cid, "Demons")

killdemons.lua
Lua:
function onKill(cid, target)

local config = {
	["demon"] = {amount = 200, storage = 19000}
}

local monster = config[getCreatureName(target):lower()]
local days = 4

	if(isPlayer(target)) or not monster then
		return true
	end

	if getPlayerStorageValue(cid, monster.storage) >= -1 then		
		setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
	end
	if (getPlayerStorageValue(cid, monster.storage) +1) == monster.amount then
		doPlayerSendTextMessage(cid, 22, "Congratulations, you got "..days.." extra premium days for killing "..(getPlayerStorageValue(cid, monster.storage) +1).." "..getCreatureName(target).."s.")
		doPlayerAddPremiumDays(cid, days)
		setPlayerStorageValue(cid, monster.storage, -1)
	end
	return true
end

ty for trying to help me, but i dont understand, im not good.. :/, can you make a script, that you will get item ( 2282 ) if you killed 200 demons ?, thank you for helping!
 
Code:
local config = {
    ["demon"] = {amount = 200, storage = 19000}
}

function onKill(cid, target)

    local monster = config[getCreatureName(target):lower()]
    if isPlayer(target) or not monster then
        return true
    end

    local stor = getPlayerStorageValue(cid, monster.storage)
    if (stor +1) < monster.amount then     
        setPlayerStorageValue(cid, monster.storage, stor + 1)
    end
    stor = getPlayerStorageValue(cid, monster.storage)
    if (stor +1) == monster.amount then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you got a rune for killing "..(stor +1).." "..getCreatureName(target).."s.")
        doPlayerAddItem(cid, 2282, 1)
        setPlayerStorageValue(cid, monster.storage, stor + 1)
    end
    return true
end
 
Last edited:
Lua:
local config = {
    ["demon"] = {amount = 200, storage = 19000}
}
local itemname = rune -- name of the item
local itemid = 2282 -- id of the item

function onKill(cid, target)

local monster = config[getCreatureName(target):lower()]

    if(isPlayer(target)) or not monster then
        return true
    end

    if getPlayerStorageValue(cid, monster.storage) >= -1 and (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount then          
        setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
    end
    if (getPlayerStorageValue(cid, monster.storage) +1) == monster.amount then
        doPlayerSendTextMessage(cid, 22, "Congratulations, you got a "..itemname.." for killing "..(getPlayerStorageValue(cid, monster.storage) +1).." "..getCreatureName(target).."s.")
        doPlayerAddItem(cid, itemid, 1)
        setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
    end
    return true
end

Limos we also can use this for frags?

Can u make for frags i mean 200 frags u get 30 points for example?
 
Back
Top