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

casino system

XouruS

Active Member
Joined
Dec 29, 2009
Messages
941
Reaction score
36
Location
Canada
can some one fix this script for me?

Code:
[22/11/2010 19:03:19] > Loading casino.xml...
[22/11/2010 19:03:22] [Lua Error] 
[22/11/2010 19:03:22] [string "loadBuffer"]:1: unexpected symbol near ','
[22/11/2010 19:03:23] [Warning - Event::loadScript] Cannot load script (		local pos = {x=1059, y=, z=925, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1059, y=, z=927, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1059, y=, z=929, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1059, y=, z=931, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1061, y=, z=923, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1063, y=, z=923, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1065, y=, z=923, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1067, y=, z=923, stackpos = 255}	
[22/11/2010 19:03:23] 		local pos = {x=1069, y=, z=923, stackpos = 255}		
[22/11/2010 19:03:23] 		local pos = {x=1071, y=, z=925, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1071, y=, z=927, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1071, y=, z=929, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1071, y=, z=931, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1061, y=, z=933, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1063, y=, z=933, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1065, y=, z=933, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1067, y=, z=933, stackpos = 255}
[22/11/2010 19:03:23] 		local pos = {x=1069, y=, z=933, stackpos = 255}
[22/11/2010 19:03:23] 		
[22/11/2010 19:03:23] 		local cash = 2160
[22/11/2010 19:03:23] 		local t = {
[22/11/2010 19:03:23] 			[{1, 55}] = 0,
[22/11/2010 19:03:24] 			[{56, 90}] = 2,
[22/11/2010 19:03:24] 			[{91, 100}] = 3
[22/11/2010 19:03:24] 		}
[22/11/2010 19:03:24] 		local a, b = getItemInfo(cash).name, getItemInfo(cash).plural
[22/11/2010 19:03:24]  
[22/11/2010 19:03:24] 		function onUse(cid, item, fromPosition, itemEx, toPosition)
[22/11/2010 19:03:24] 			local v = getThingfromPos(pos)
[22/11/2010 19:03:24] 			if v.itemid ~= cash then
[22/11/2010 19:03:24] 				return doCreatureSay(cid, 'You can only use ' .. b .. '.', TALKTYPE_ORANGE_1, false, cid)
[22/11/2010 19:03:24] 			end
[22/11/2010 19:03:24]  
[22/11/2010 19:03:24] 			local r = math.random(100)
[22/11/2010 19:03:24] 			for i, k in pairs(t) do
[22/11/2010 19:03:24] 				if r >= i[1] and r <= i[2] then
[22/11/2010 19:03:24] 					doRemoveItem(v.uid)
[22/11/2010 19:03:24] 					if k < 1 then
[22/11/2010 19:03:24] 						doCreatureSay(cid, 'You lost ' .. v.type .. ' ' .. (v.type == 1 and a or b) .. ' :(', TALKTYPE_ORANGE_1, false, cid)
[22/11/2010 19:03:24] 						doSendMagicEffect(pos, CONST_ME_POFF)
[22/11/2010 19:03:24] 					else
[22/11/2010 19:03:24] 						doCreatureSay(cid, 'You won ' .. v.type * k .. ' ' .. (v.type == 1 and a or b) .. ' :)', TALKTYPE_ORANGE_1, false, cid)
[22/11/2010 19:03:25] 						doCreateItem(cash, v.type * k, pos)
[22/11/2010 19:03:25] 						doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
[22/11/2010 19:03:25] 						doSendMagicEffect(toPosition, CONST_ME_SOUND_YELLOW)
[22/11/2010 19:03:25] 					end
[22/11/2010 19:03:25] 					return true
[22/11/2010 19:03:25] 				end
[22/11/2010 19:03:25] 			end
[22/11/2010 19:03:25] 		end
[22/11/2010 19:03:25] 	)
[22/11/2010 19:03:25] [string "loadBuffer"]:1: unexpected symbol near ','


Code:
<?xml version="1.0" encoding="utf-8"?>
<mod name="Casino lever" enabled="yes">
  <action uniqueid="5885" event="script"><![CDATA[
		local pos = {x=1059, y=, z=925, stackpos = 255}
		local pos = {x=1059, y=, z=927, stackpos = 255}
		local pos = {x=1059, y=, z=929, stackpos = 255}
		local pos = {x=1059, y=, z=931, stackpos = 255}
		local pos = {x=1061, y=, z=923, stackpos = 255}
		local pos = {x=1063, y=, z=923, stackpos = 255}
		local pos = {x=1065, y=, z=923, stackpos = 255}
		local pos = {x=1067, y=, z=923, stackpos = 255}	
		local pos = {x=1069, y=, z=923, stackpos = 255}		
		local pos = {x=1071, y=, z=925, stackpos = 255}
		local pos = {x=1071, y=, z=927, stackpos = 255}
		local pos = {x=1071, y=, z=929, stackpos = 255}
		local pos = {x=1071, y=, z=931, stackpos = 255}
		local pos = {x=1061, y=, z=933, stackpos = 255}
		local pos = {x=1063, y=, z=933, stackpos = 255}
		local pos = {x=1065, y=, z=933, stackpos = 255}
		local pos = {x=1067, y=, z=933, stackpos = 255}
		local pos = {x=1069, y=, z=933, stackpos = 255}
		
		local cash = 2160
		local t = {
			[{1, 55}] = 0,
			[{56, 90}] = 2,
			[{91, 100}] = 3
		}
		local a, b = getItemInfo(cash).name, getItemInfo(cash).plural
 
		function onUse(cid, item, fromPosition, itemEx, toPosition)
			local v = getThingfromPos(pos)
			if v.itemid ~= cash then
				return doCreatureSay(cid, 'You can only use ' .. b .. '.', TALKTYPE_ORANGE_1, false, cid)
			end
 
			local r = math.random(100)
			for i, k in pairs(t) do
				if r >= i[1] and r <= i[2] then
					doRemoveItem(v.uid)
					if k < 1 then
						doCreatureSay(cid, 'You lost ' .. v.type .. ' ' .. (v.type == 1 and a or b) .. ' :(', TALKTYPE_ORANGE_1, false, cid)
						doSendMagicEffect(pos, CONST_ME_POFF)
					else
						doCreatureSay(cid, 'You won ' .. v.type * k .. ' ' .. (v.type == 1 and a or b) .. ' :)', TALKTYPE_ORANGE_1, false, cid)
						doCreateItem(cash, v.type * k, pos)
						doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
						doSendMagicEffect(toPosition, CONST_ME_SOUND_YELLOW)
					end
					return true
				end
			end
		end
	]]></action>
</mod>

i rep++
 
Thats where he made it wrong, he didnt set the Y position.
Y its to noe the coordinates of the map
X >>>>>>>>>>>>>and <<<<<<<<<<<<<<
Y^^^^^^^^^^^and VVVVVVVVVVVV
Z= floor
 
Back
Top