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

boolean value?

Triggah

TrigCore
Joined
Aug 1, 2007
Messages
436
Reaction score
2
i made a donation chest that gives exp

and i get this error:

data/actions/scripts/other/donatorchest.lua:21: attempt to concatenate a boolean value
[20/07/2009 03:54:37] stack traceback:
[20/07/2009 03:54:37] data/actions/scripts/other/donatorchest.lua:21: in function <data/actions/scripts/other/donatorchest.lua:1>

what is boolean value?
 
fixed the boolean thing but i cant fixure out how to make this usable again after using it 25 times and (in my server when u log out ur char reset back to wat it was but storage values/quests stay) i have 2 scripts. Also when player uses the storage id that gives the player ability to use the chest, if person relogs he/she cant use donation chest again (even if didnt use 25 uses).
Code:
function onUse(cid, item, frompos, item2, topos)

--config--
local VIPstorage = 11552 --storage id of VIP feature--
local Message = "CONGRATULATIONS! You are now a able to use Exp Chest!" --message when successful--
local CancelMSG = 'Error in script.' --error message--
local AniMSG = "Exp!" --max of 9 characters (includes spaces)--
--end config--

	if getPlayerLevel(cid) > 1 then
		doSendAnimatedText(getPlayerPosition(cid), AniMSG, TEXTCOLOR_RED) 
		doCreatureSay(cid, Message, TALKTYPE_ORANGE_1)
		setPlayerStorageValue(cid, VIPstorage, 1)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid, CancelMSG)
	end
return TRUE
end
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	 --config--
	local EXPamount = 28118000 --amount of exp player recieves for each use.
	local VIPstorage = 11552 --the storage of you VIP system.
	local USEstorage = 12341 --is the storage used to store amount of uses, can be any storage not used.
	local notdonator = "Only donators may use this chest" --message received if player is not a donator.
	local nomoreuses = "You have used all of your 25 uses of this chest" -- received if player has no more uses.
	local maxuses = 25
	--end config--
	
		if(getPlayerStorageValue(cid, VIPstorage) == 1) and (getPlayerStorageValue(cid, USEstorage) <= maxuses) then
			doPlayerAddExperience(cid, EXPamount)
			setPlayerStorageValue(cid, USEstorage, (getPlayerStorageValue(cid, USEstorage)+1))
		elseif(getPlayerStorageValue(cid, VIPstorage) == 1) and (getPlayerStorageValue(cid, USEstorage) > maxuses) then		
			doPlayerSendCancel(cid, nomoreuses)
			return false
		else
			doPlayerSendCancel(cid, notdonator)	
			return false
		end
	return true
end
 
Kinda confucing, so, you want me to:

Make the chest usable 25 times...
If the player uses the vip shit, they can use the chest again


Thats it?...


Now, seriously, i've said this like 10 times, but now SERIOUSLY i have to go to sleep, answer, and ill make this for you tomorrow, dont worry. 5:30am xD
 
i want it to be like this:

when u use id 7722 u get access to use the donator exp chest 25 times, but needs to work like if u use once and log out or die u can use 24 more times. And make it so it can only be used once per login.

can u do that?
 
Once per login? or once per server reset?

If it were once per login they could just re-log over and over again.

Once that question is answered I should be able to help you. :)

-Zeke
 
From what I can tell.. your script should be working..? When a player logs back in do you (server side) get an error message that we can work with? or does it just not work.
 
Two things I can come up with..

1. What happens if you re-use the item that gives you donator privileges? Can you then use the chest over again?

2. Check the database and make sure the storage values are remaining when you log off.
 
1. no after 25 uses if u reuse the item that gives u priviledges u cannot use it another 25 times (but i want it to be usable again)

2. ill tell u in a bit, my friend is off and hes my host
 
Back
Top