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

Quest Chest Script is needed!

Naxtie

mapper, designer
Joined
Oct 15, 2011
Messages
1,565
Solutions
1
Reaction score
250
Location
Sweden
Hello, I would like a "Quest Chest" Script that works for TFS 0.3.6, currently im using this one and it doesnt work at all...

PHP:
function onUse(cid, item, frompos, item2, topos) 
	if getPlayerStorageValue(cid, 10500) ~= 1 and getPlayerLevel(cid) >= 50 then -- if is more than level 50
        doPlayerSendTextMessage(cid,22,"Here is your reward!") 
        doPlayerAddItem(cid,2494,1) -- edit item id 2160 to your item you want to give reaching this level.
        setPlayerStorageValue(cid, 10500, 1) 
    else 
        doPlayerSendCancel(cid,"It is empty or you don't have enough level.") 
 
    end 
 
return TRUE 
end
 
This should work for sure

LUA:
function onUse(cid, item)

	if getPlayerStorageValue(cid, 10500) < 1 then
		if getPlayerLevel(cid) >= 50 then
			doPlayerSendTextMessage(cid, 22, "Here is your reward!"
			doPlayerAddItem(cid, 2494, 1)
			setPlayerStorageValue(cid, 10500, 1)
		else
			doPlayerSendTextMessaye(cid, 22, "You need level 50.")
		end
	else
		doPlayerSendTextMessage(cid, 22, "It's empty.")
	end
	

	return true
end
 
And btw... What should I type on the ActionID's and UniqueID's? And where to put that Storage? Nowhere? x) (I'm a bit noob at .lua etc... I'm only learning php ;/)

@up Should'nt this line be added somewhere in ur script to? I mean your script and TibiaWR's script looks diffirent in the most ways (what I can see)
if getPlayerStorageValue(cid, k.storage) < 0 then
 
Why are people using the ~= operator in their lua if statements? Its shitty lol and only allows for one storage key. :S
 
Back
Top