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

This Is The Error?

Sweddy

Well-Known Member
Joined
Feb 14, 2009
Messages
2,907
Reaction score
93
Location
Sweden
When i use this in TFS 0.3.6 and when people go in the room this stuffs are in, their client crashes :S is it wrong script or does it not elong to TFS 0.3.6?

Lua:
local config = {
--First Floor
        [7958] = {cost = 25, amount = 1}, --jester staff
		[7368] = {cost = 25, amount = 1}, --assassin stars
		[7415] = {cost = 25, amount = 1}, --demonic warmace
		[2415] = {cost = 25, amount = 1}, --demonic waraxe
		[7390] = {cost = 25, amount = 1}, --demonic warblade

		[9776] = {cost = 25, amount = 1}, --yalahari armor
		[9777] = {cost = 25, amount = 1}, --yalahari legs
		[9778] = {cost = 25, amount = 1}, --yalahari mask
		[2523] = {cost = 25, amount = 1}, --blessed shield
		[2343] = {cost = 25, amount = 1}, --helmet of the ancients
		
		[3982] = {cost = 15, amount = 1}, --crocodile boots
		[2645] = {cost = 15, amount = 1}, --steel boots
		[2646] = {cost = 50, amount = 1}, --golden boots
		[2195] = {cost = 15, amount = 1}, --boots of haste
		[6132] = {cost = 25, amount = 1}, --soft boots
		
--Second Floor
		[10529] = {cost = 25, amount = 1}, --serpent trophy
		[8976] = {cost = 25, amount = 1}, --golden falcon
		[5929] = {cost = 25, amount = 1}, --goldfish bowl
		[2113] = {cost = 25, amount = 1}, --model ship
		[5805] = {cost = 25, amount = 1}, --golden goblet
		
		[9743] = {cost = 5, amount = 1}, --upgrade crystal
		[4567] = {cost = 30, amount = 1}, --armor upgrade crystal
		[4455] = {cost = 30, amount = 1}, --defense upgrade crystal
		[8306] = {cost = 30, amount = 1}, --attack upgrade crystal
		[7722] = {cost = 15, amount = 1}, --experience scroll
		
		[2198] = {cost = 15, amount = 1000}, --elven amulet
		[4569] = {cost = 25, amount = 1000}, --elven amulet loss
		[2197] = {cost = 25, amount = 15}, --stone skin amulet
		[2127] = {cost = 25, amount = 1}, --bangel of death
		[9971] = {cost = 45, amount = 100} --gold bars
		
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local reward = config[item.actionid]
        if getPlayerItemCount(cid, 9020) >= reward.cost then
				Added = doPlayerAddItem(cid,item.actionid,reward.amount)
				doChangeTypeItem(Added, reward.amount)
				doPlayerRemoveItem(cid,9020,reward.cost)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You bought '..getItemArticleById(item.actionid)..' '..getItemNameById(item.actionid)..' for '..reward.cost..' tokens.')
        else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you do not have enough tokens.")
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need "..reward.cost.." tokens for "..getItemArticleById(item.actionid).." "..getItemNameById(item.actionid)..".")
       end
        return TRUE
end8
 
Maybe you should to change this:
Lua:
Added = doPlayerAddItem(cid,item.actionid,reward.amount)
to this:
Lua:
local Added = doPlayerAddItem(cid,item.actionid,reward.amount)
 
Back
Top