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

Why does this script not work?

You forgot to declare cid in the event, that's why.

Lua:
local config = {
	message = "BOSS +1",
	color = COLOR_WHITE,
	bosses = { -- Monster Name,  Storagevalue,
				["Ra revenge"] = {storage=51001},
				["warshabaal"] = {storage=51002},
				["Seadevil"] = {storage=51003},
                ["Haunted dragon"] = {storage=51004},
                ["Thunder dragon"] = {storage=51005},
				["green-eyes red dragon"] = {storage=51006},
				["Chaos emperor dragon"] = {storage=51007},
				["Vampire genesis"] = {storage=51008},
				["dark ruler ha des"] = {storage=51009},
				["Amidamaru"] = {storage=51010},
				["Bason"] = {storage=51011},
				["eliza faust"] = {storage=51012},
				["fortress golem"] = {storage=51013},
				["illusionist"] = {storage=51014},
				["iron maiden jeanne"] = {storage=51015},
				["kouki"] = {storage=51016},
				["zenki"] = {storage=51017},
				["lanancuras"] = {storage=51018},
				["red eyes ultimate dragon"] = {storage=51019},
				["silva"] = {storage=51020},
				["zorc necrophadus"] = {storage=51021},
				["King scorpion"] = {storage=51022},
				["Bazir"] = {storage=51023},
				["Apocal"] = {storage=51024},
				["infernal"] = {storage=51025},
				["Orshabaal"] = {storage=51026},
				["Morgaroth"] = {storage=51027},
				["verminor"] = {storage=51028},
				["saggi the dark clown"] = {storage=51029},
			},
}
 
function onKill(cid,target,lastHit)
local b = config.bosses[getCreatureName(target)]
	function exp(cid)
		setPlayerStorageValue(cid,b.storage,1)
		doSendAnimatedText(getCreaturePosition(cid),config.message, config.color)
	end
	if b then
		addEvent(exp, 2 * 1000, cid)
	end
	return true
end



kind regards, Evil Hero.
 
Last edited:
thanks i will test it :)
edit: doesn't work
fz6789.png
 
Last edited:
You forgot to declare cid in the event, that's why.

Lua:
local config = {
	message = "BOSS +1",
	color = COLOR_WHITE,
	bosses = { -- Monster Name,  Storagevalue,
				["Ra revenge"] = {storage=51001},
				["warshabaal"] = {storage=51002},
				["Seadevil"] = {storage=51003},
                ["Haunted dragon"] = {storage=51004},
                ["Thunder dragon"] = {storage=51005},
				["green-eyes red dragon"] = {storage=51006},
				["Chaos emperor dragon"] = {storage=51007},
				["Vampire genesis"] = {storage=51008},
				["dark ruler ha des"] = {storage=51009},
				["Amidamaru"] = {storage=51010},
				["Bason"] = {storage=51011},
				["eliza faust"] = {storage=51012},
				["fortress golem"] = {storage=51013},
				["illusionist"] = {storage=51014},
				["iron maiden jeanne"] = {storage=51015},
				["kouki"] = {storage=51016},
				["zenki"] = {storage=51017},
				["lanancuras"] = {storage=51018},
				["red eyes ultimate dragon"] = {storage=51019},
				["silva"] = {storage=51020},
				["zorc necrophadus"] = {storage=51021},
				["King scorpion"] = {storage=51022},
				["Bazir"] = {storage=51023},
				["Apocal"] = {storage=51024},
				["infernal"] = {storage=51025},
				["Orshabaal"] = {storage=51026},
				["Morgaroth"] = {storage=51027},
				["verminor"] = {storage=51028},
				["saggi the dark clown"] = {storage=51029},
			},
}
 
function onKill(cid,target,lastHit)
local b = config.bosses[getCreatureName(target)]
	function exp(cid)
		setPlayerStorageValue(cid,b.storage,1)
		doSendAnimatedText(getCreaturePosition(cid),config.message, config.color)
	end
	if b then
		addEvent(exp, 2 * 1000, cid)
	end
	return true
end



kind regards, Evil Hero.

I sense some bullshit here, if b worked inside exp function, why wouldn't cid do?

@Edit:
Also this has worked:
hlgGr.png


So he probably had to move function exp above addEvent.
 
Last edited:
I sense some bullshit here, if b worked inside exp function, why wouldn't cid do?

Well I've taken a fast look over it and there aint no bullshit here as cid was not declared neither is b which referes to target.

Lua:
function onKill(cid,target,lastHit)
local config = {
	message = "BOSS +1",
	color = COLOR_WHITE,
	bosses = { -- Monster Name,  Storagevalue,
				["Ra revenge"] = {storage=51001},
				["warshabaal"] = {storage=51002},
				["Seadevil"] = {storage=51003},
                ["Haunted dragon"] = {storage=51004},
                ["Thunder dragon"] = {storage=51005},
				["green-eyes red dragon"] = {storage=51006},
				["Chaos emperor dragon"] = {storage=51007},
				["Vampire genesis"] = {storage=51008},
				["dark ruler ha des"] = {storage=51009},
				["Amidamaru"] = {storage=51010},
				["Bason"] = {storage=51011},
				["eliza faust"] = {storage=51012},
				["fortress golem"] = {storage=51013},
				["illusionist"] = {storage=51014},
				["iron maiden jeanne"] = {storage=51015},
				["kouki"] = {storage=51016},
				["zenki"] = {storage=51017},
				["lanancuras"] = {storage=51018},
				["red eyes ultimate dragon"] = {storage=51019},
				["silva"] = {storage=51020},
				["zorc necrophadus"] = {storage=51021},
				["King scorpion"] = {storage=51022},
				["Bazir"] = {storage=51023},
				["Apocal"] = {storage=51024},
				["infernal"] = {storage=51025},
				["Orshabaal"] = {storage=51026},
				["Morgaroth"] = {storage=51027},
				["verminor"] = {storage=51028},
				["saggi the dark clown"] = {storage=51029},
			},
}
local b = config.bosses[getCreatureName(target)]
	function exp(cid, target)
		setPlayerStorageValue(cid,b.storage,1)
		doSendAnimatedText(getCreaturePosition(cid),config.message, config.color)
	end
	if b then
		addEvent(exp, 2 * 1000, cid, target)
	end
	return true
end



kind regards, Evil Hero.
 
@2x UP Yo put a function inside an another function and try to calling that function inside a this function in this function, so a function u callen in that function cannot work functionally proper.

Lua:
addEvent(doSendAnimatedText, 2 * 1000, getCreaturePosition(cid),config.message, config.color)

storage can be set immendially.
 
Back
Top