• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Add storage onDeath

Felipe Monteiro

Webmaster
Joined
Feb 27, 2009
Messages
460
Reaction score
59
Location
Brasil
Hello Guys.
I'm work with script of my one quest, but by my few knowledge i dont know to do some things.

Explaining what I want.
A script that when I kill the monster I won a storage, and only with this storage i can open the chest with my rewards.

Thanx ;D
 
Creaturescript :

LUA:
--[[
Storage Killer by Potar (otland.net/members/potar)
ver: 1.0
date: 2012-11-02 
]]--

function onKill(cid, target, lastHit)
local creatures = {
["Rat"] = { storage = 99999 , value = 1, text = "You may open the chest now!"} --,
--["Demom"] = { storage = 99998 , value = 1, text = "You may open the chest now!"},
--["Dragon"] = { storage = 99997 , value = 1, text = "You may open the chest now!"}, -- you can also add more monsters
}
local p = creatures[getCreatureName(target)]
	if (not isPlayer(target)) and isPlayer(cid) and p and getPlayerStorageValue(cid, p.storage) <= 0 then
			doPlayerSetStorageValue(cid, p.storage, p.value)
			doPlayerSay(cid, p.text, TALKTYPE_ORANGE_1)
	end
return true
end

Actions:

LUA:
function onUse(cid, item, frompos, item2, topos) 
local storage = 99999
    if getPlayerStorageValue(cid, storage) == 1 then
		doPlayerSetStorageValue(cid, sotrage, 2) -- must be 2, now you cannot take prize again!
		doPlayerAddItem(cid, 2160, 1) -- item and count
		doPlayerSay(cid, "You have recived the item!", TALKTYPE_ORANGE_1)
	end
return true
end
 
Last edited:
Back
Top