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

"Casino" script - not the normal casino - very different ó.Ó

Luciano

Member
Joined
Feb 18, 2010
Messages
998
Reaction score
24
So, the script i need should run like this :

21mgu1h.png

Red (basin) = player put there 1 gold ingot (equivalent in my server to 100 gold nugets) or he can also put 100 gold nugets (each gold nugget = 100cc)

Green (basin) = after player pull the switch (brown) he will win 1 item, random, like this:

class / item / chance / text
[1] - X - 5 (less) - Very Nice!
[2] - Y - 10 (more than 1) - Good!
[3] - Z - 20 (more than 2) - Bad!
[4] - K - 30 (more than 3) - Very Bad!


THe text is like the player win a item of class 1, it will come up the text Very nice on the spot he is (can be getplayerpos or can be a fixed pos....)

OBS: it is not only one item on class 1... 2... its more than 5 :P



THANKS so much on advance, and REP++ ofc ^^ post in this thread with some good stuff = rep++

edit: i know i sux at paint
 
Last edited:
Its been a month now and nobody's made this for you, why don't you hire a scripter or learn yourself? You could have already learned the needed lua to code this already if you wanted it this bad.
 
wow you here to flame? and i have school, and only bump to see if someone new or something have it and give me or something... also ... stop posting shit to get more posts. kthxbye
 
Try this one...

casino.lua:
LUA:
local CASINO = { -- Position of the basins
	[4510] = {credit = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}, win = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}},
	[4511] = {credit = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}, win = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}},
	[4512] = {credit = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}, win = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}},
	[4513] = {credit = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}, win = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}}
}

local CHANCE = { -- Chances to obtain certain prize
	[1] = {min = 0, max = 10, itemid = ?, count = ?, MessageClasses = MESSAGE_INFO_DESCR, message = "Very Nice!"},
	[2] = {min = 11, max = 30, itemid = ?, count = ?, MessageClasses = MESSAGE_INFO_DESCR, message = "Good!"},
	[3] = {min = 31, max = 60, itemid = ?, count = ?, MessageClasses = MESSAGE_STATUS_WARNING, message = "Bad!"},
	[4] = {min = 61, max = 100, itemid = ?, count = ?, MessageClasses = MESSAGE_STATUS_WARNING, message = "Very Bad!"}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local casino = CASINO[item.actionid]
	local thing = getThingFromPos(casino.credit, false)
	if(isInArray({2157, 9971}, thing.itemid)) then
		if(doRemoveItem(thing.uid, thing.itemid == 9971 and 1 or 100) == RETURNVALUE_NOERROR) then
			for i = 1, #CHANCE do
				local random = math.random(1, 100)
				if(random > CHANCE[i].min and random <= CHANCE[i].max) then
					doCreateItem(CHANCE[i].itemid, CHANCE[i].count, casino.win)
					doPlayerSendTextMessage(cid, CHANCE[i].MessageClasses, CHANCE[i].message)
					break
				end
			end
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		end
	end

	return doTransformItem(item.uid, item.itemid == 9825 and 9826 or 9825)
end

The actionids go from 4510 to 4513 (can be extended). You have to put a different AID in the each lever and replace all the '?' for values.
I needed this too so I made it.

EDIT: Just a bug fix.
EDIT 2: Another bug fix.
EDIT 3: One last bug fix. Just to let you know...I'm not testing this. I just see the bugs and fix them.
 
Last edited:
Try this one...

casino.lua:
LUA:
local CASINO = { -- Position of the basins
	[4510] = {credit = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}, win = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}},
	[4511] = {credit = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}, win = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}},
	[4512] = {credit = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}, win = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}},
	[4513] = {credit = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}, win = {x = ?, y = ?, z = ?, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}}
}

local CHANCE = { -- Chances to obtain certain prize
	[1] = {min = 0, max = 10, itemid = ?, count = ?, MessageClasses = MESSAGE_INFO_DESCR, message = "Very Nice!"},
	[2] = {min = 11, max = 30, itemid = ?, count = ?, MessageClasses = MESSAGE_INFO_DESCR, message = "Good!"},
	[3] = {min = 31, max = 60, itemid = ?, count = ?, MessageClasses = MESSAGE_STATUS_WARNING, message = "Bad!"},
	[4] = {min = 61, max = 100, itemid = ?, count = ?, MessageClasses = MESSAGE_STATUS_WARNING, message = "Very Bad!"}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local casino = CASINO[item.actionid]
	local thing = getThingFromPos(casino.credit, false)
	if(isInArray({2157, 9971}, thing.itemid)) then
		if(doRemoveItem(thing.uid, thing.itemid == 9971 and 1 or 100) == RETURNVALUE_NOERROR) then
			for i = 1, #CHANCE do
				local random = math.random(1, 100)
				if(random > CHANCE[i].min and random <= CHANCE[i].max) then
					doCreateItem(CHANCE[i].itemid, CHANCE[i].count, casino.win)
					doPlayerSendTextMessage(cid, CHANCE[i].MessageClasses, CHANCE[i].message)
					break
				end
			end
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		end
	end

	return doTransformItem(item.uid, item.itemid == 9825 and 9826 or 9825)
end

The actionids go from 4510 to 4513 (can be extended). You have to put a different AID in the each lever and replace all the '?' for values.
I needed this too so I made it.

EDIT: Just a bug fix.
EDIT 2: Another bug fix.
EDIT 3: One last bug fix. Just to let you know...I'm not testing this. I just see the bugs and fix them.

thank you ! + rep
 
Back
Top