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

(HELP PLX) Kill and add storage

Bulet

Knight of Apocalypse
Joined
Jul 12, 2009
Messages
183
Reaction score
9
Location
Brazil
i need script who player kill monster and receive a storage

i think on that but dont work plx help me

Code:
local m = {
	["Ungreez"] = {
		message = "Congratulations you are owned Ungreez now you are able to preceed to next mission!",
		owned = "You already do that mission go to next mission!",
		cfg = {
			{
				storage = 1290, -- Storage.
				storagevalue = 6, -- Storage Quest Value.
			},
		}
	},
	["Koshei The Deathless"] = {
		message = "You had killed Koshei The Deathless now you can get your prize!",
		owned = "You already have killed Koshei The Deathless go and get your prize!",
		cfg = {
			{
				storage = 21187, -- Storage.
				storagevalue = 1, -- Storage Quest Value.				
			},
		}
	}

	
}

function onKill(cid, target)
	if isPlayer(target) then
		return true
	end
	local monster = m[getCreatureName(target)]
	if monster then
		for i = 1, #monster.cfg do
			local c = monster.cfg[i]
					if(storage > monster.storagevalue) then
		            doCreatureSay(cid, monster.owned, TALKTYPE_ORANGE_1)
					else
			setPlayerStorageValue(cid,monster.storage,monster.storagevalue)
			doCreatureSay(cid, monster.message, TALKTYPE_ORANGE_1)
	        end
			
	end		
	end
	return true
end
 
Code:
if getCreatureName(target) == "Rotworm" then
    setPlayerStorageValue(cid,storage,1)
end

Basically thats all you need as far as I can see.
 
try this men;
Code:
local v = {
	["Ungreez"] = {message = "Congratulations you are owned Ungreez now you are able to preceed to next mission!", owned = "You already do that mission go to next mission!", storage = 1290, storageValue = 6}
	["Koshei The Deathless"] = {message = "You had killed Koshei The Deathless now you can get your prize!", owned = "You already have killed Koshei The Deathless go and get your prize!", storage = 21187, storageValue = 1}
}
function onKill(cid, target, lastHit)
	local monster = v[getCreatureName(target)]
	if monster then
		if getPlayerStorageValue(cid, monster.storage) > monster.value then
			doCreatureSay(cid, monster.owned, TALKTYPE_ORANGE_1)
		else
			setPlayerStorageValue(cid,monster.storage, monster.storageValue)
			doCreatureSay(cid, monster.message, TALKTYPE_ORANGE_1)
		end
	end
	return true
end
 
@OzIcO

falt "," but with that too dont work

Dont work, on phpmyadmin i dont got storage ...
I think is owned msg i remove that and script works fine tks bro for you help rep +++


error
Code:
> SAVE: Complete in 0.719 seconds using binary house storage.
[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/killStorage.
lua:3: '}' expected (to close '{' at line 1) near '['
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/k
illStorage.lua)
data/creaturescripts/scripts/killStorage.lua:3: '}' expected (to close '{' at li
ne 1) near '['
 
Last edited:
Code:
function onKill(cid, target, lastHit)
	local m = {
		["Koshei The Deathless"] = {
			cfg = {
				msg = "You have killed [Koshei The Deathless]. Now you can get your prize!",
				storage = 21187
			}
		}
	}
	if isPlayer(target) then
		return true
	end
	local monster = m[getCreatureName(target)]
	if monster then
		for i = 1, #monster.cfg do
			local v = monster.cfg[i]
			if(getPlayerStorageValue(cid, v.storage) == 1) then
				doPlayerSendCancel(cid, "You have already killed " .. monster .. ".")
			else
				doCreatureSay(cid, v.msg, TALKTYPE_ORANGE_1)
				setPlayerStorageValue(cid, v.storage, 1)
			end
		end
	end
	return true
end
 
Last edited:
Code:
function onKill(cid, target, lastHit)
	local m = {
		["Koshei The Deathless"] = {
			[B][COLOR="Red"]cfg = {[/COLOR][/B]
				msg = "You have killed [Koshei The Deathless]. Now you can get your prize!",
				storage = 21187
			[B][COLOR="Red"]}[/COLOR][/B]
		}
	}
[I]	if [COLOR="Red"]isPlayer(target)[/COLOR] then
		[COLOR="Red"]return true[/COLOR]
	end[/I]
	local monster = m[getCreatureName(target)]
	if monster then
		for i = 1, #m.cfg do
			local v = m.cfg[i]
			if(getPlayerStorageValue(cid, v.storage) == 1) then
				doPlayerSendCancel(cid, "You have already killed " .. monster .. ".")
			else
				doCreatureSay(cid, v.msg, TALKTYPE_ORANGE_1)
				setPlayerStorageValue(cid, v.storage, 1)
			end
		end
	end
	return true
end
???
 
Back
Top