• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Chest LEVEL

perwal

New Member
Joined
Jul 14, 2011
Messages
65
Reaction score
1
Location
Poland Torun
Hiho,
Im looking for script on chest level. If i have 50 level i can go to the chest and reward around 100k. What it is script? I have TFS 0.3.6, client version 8.54/8.60
 
chest.lua
LUA:
function onUse(cid, item)
 
	if getPlayerStorageValue(cid, 10000) < 1 then
		if getPlayerLevel(cid) >= 50 then
			doPlayerSendTextMessage(cid, 22, "You have found 10 crystal coins."
			doPlayerAddItem(cid, 2160, 10)
			setPlayerStorageValue(cid, 10000, 1)
		else
			doPlayerSendTextMessaye(cid, 22, "You don't have enough level.")
		end
	else
		doPlayerSendTextMessage(cid, 22, "It's empty.")
	end 
 
	return true
end

actios.xml
XML:
<action actionid="1111" event="script" value="chest.lua"/>
 
Eeee? I have small problems

[Error - LuaScriptInterface::loadFile] data/actions/scripts/chest.lua:6: ')' expected (to close '(' at line 5) near 'doPlayerAddItem'
[16/11/2012 14:01:53] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/chest.lua)
[16/11/2012 14:01:53] data/actions/scripts/chest.lua:6: ')' expected (to close '(' at line 5) near 'doPlayerAddItem'


My file:
Code:
function onUse(cid, item)
 
	if getPlayerStorageValue(cid, 10000) < 1 then
		if getPlayerLevel(cid) >= 80 then
			doPlayerSendTextMessage(cid, 22, "Gratulacje zdobyles 10 crystal coin."
			doPlayerAddItem(cid, 2160, 10)
			setPlayerStorageValue(cid, 10000, 1)
		else
			doPlayerSendTextMessaye(cid, 22, "Nie posiadasz jeszcze 80 levela!")
		end
	else
		doPlayerSendTextMessage(cid, 22, "Otrzymales juz swoja nagrode.")
	end 
 
	return true
end
 
LUA:
function onUse(cid, item)
 
	if getPlayerStorageValue(cid,10000) < 1 then
		if getPlayerLevel(cid) >= 50 then
			doPlayerSendTextMessage(cid,22,"You have found 10 crystal coins.")
			doPlayerAddItem(cid,2160,10)
			setPlayerStorageValue(cid,10000,1)
		else
			doPlayerSendTextMessaye(cid,22,"You don't have enough level.")
		end
	else
		doPlayerSendTextMessage(cid,22,"It's empty.")
	end  
	return true
end
 
Back
Top