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

[Action] Casino with Dice's + Global Jackpot

Elvarion

Member
Joined
Apr 14, 2010
Messages
99
Reaction score
13
Looking for someone that is willing to do Casino script for a Gambling Addict! /Nah the Gambling addic is a lie, But id like to get my hands on a script that works like i will describe below =)

The script should consist in a Casino script that involves the Dices (shown below) and a global Jackpot (Something like this http://otland.net/f132/jackpot-request-85905/)

First a picture of the setup;
You got a Lever infront of you. Then there are 3 dices that you are unable to reach.
(Not sure about how this will work when there is a clean)
Maybe it should be done like this
(Pull lever -> Create dices. -> Pull lever again, Remove old dices and create new ones)



Then when you pull the lever the dices spin!!:blink::blink::blink:


Then the script will do a check if the dices match the pre-set "winning board"
Like, 3x dice with the same number = Win (different rewards for 1-6)

The "win-table"
Should be like this

Lua:
3 Dices with number 1 - xxxx money / and or item
3 Dices with number 2 - xxxx money / and or item
3 Dices with number 3 - xxxx money / and or item
3 Dices with number 4 - xxxx money / and or item
3 Dices with number 5 - xxxx money / and or item
3 Dices with number 6 -xxxx money / and or item

2 Dices with number 1 - xxxx money / and or item
2 Dices with number 2 - xxxx money / and or item
2 Dices with number 3 - xxxx money / and or item
2 Dices with number 4 - xxxx money / and or item
2 Dices with number 5 - xxxx money / and or item
2 Dices with number 6 - xxxx money / and or item

Here are the ids for the different dices

Lua:
1 - 5792
2 - 5793
3 - 5794
4 - 5795
5 - 5796
6 - 5797

If there is any more information you wish to have, Feel free to contact me!
Thanks in advance =)
 
Ah. I understand should have read more into the script ^^,
Thanks for clarifying for me.

I like the way the lever behaves, Gives some "feeling" that its almost like a slot machine. And it slows down the general playing a bit. So that you just cant Spam the lever like a madman.

I removed
reward = 2160, count = 10,
from those combo's that are JP. But when winning the Jackpot i got a error in the console.
Maybe its better to create some sort of item that you also win when you get jackpot. Thinking of maybe something like a scroll/parchment with a special description..
10:49 You see a lottery diploma.
It weighs 1.20 oz.
You were lucky! You won the Jackpot of ..(Jackpot).. on ..(Date)..!
Just a suggestion of some sort. Dunno if its possible ^^,

A question; GlobalStorage, Are they always saved? Since i shutdown the server last night right after i had won a JP, then when i started the server today the JP was set at 1m gold.
 
Cool np I'm using it too. it was fun.
Btw if you rlly want that lottery thing I'll add it. But if it's not a big deal I wont since I don't want it
 
Last edited:
Lua:
function onUse(cid, item, frompos, item2, topos)


local dicepos1 = {x=84, y=80, z=5, stackpos=254}
local dicepos2 = {x=85, y=80, z=5, stackpos=255}
local dicepos3 = {x=86, y=80, z=5, stackpos=254}
local coal = {x=85, y=81, z=5, stackpos=1}
local exit = {x=91, y=80, z=5, stackpos=254}


Bet = getPlayerSlotItem(cid, 10)

if Bet.itemid == 2157 then
		Type = " gold nugget"
	-- elseif Bet.itemid == 9971 then
		-- Type = " gold ingot"
	else
		doPlayerSendTextMessage(cid, 25, "[Roll] Ponha seus gold nuggets ou ingots no slot Arrow para serem sua aposta.")
	return TRUE
end

if (getGlobalStorageValue(51651) ==  getPlayerGUID(cid)) then
	doTeleportThing(cid, exit, TRUE)
	doPlayerSendTextMessage(cid, 25, "[Roll] Voce foi o ultimo a jogar.")
	return TRUE
end


local playerpos = getCreaturePosition(cid)
if playerpos.x == 85 and playerpos.y == 82 then
setGlobalStorageValue(51651, getPlayerGUID(cid))


local player = getPlayerPosition(cid)
local Roll_1 = math.random(5792, 5797)
local Roll_2 = math.random(5792, 5797)
local Roll_3 = math.random(5792, 5797)

number_1 = Roll_1 - 5791
number_2 = Roll_2 - 5791
number_3 = Roll_3 - 5791

doPlayerRemoveItem(cid,Bet.itemid,1)

doTransformItem(getThingFromPos(dicepos1).uid, Roll_1)
doTransformItem(getThingFromPos(dicepos2).uid, Roll_2)
doTransformItem(getThingFromPos(dicepos3).uid, Roll_3)
doSendMagicEffect(dicepos1, 26)
doSendMagicEffect(dicepos2, 26)
doSendMagicEffect(dicepos3, 26)
doSendAnimatedText(dicepos1, number_1.. '.', TALKTYPE_ORANGE_1)
doSendAnimatedText(dicepos2, number_2 .. '.', TALKTYPE_ORANGE_1)
doSendAnimatedText(dicepos3, number_3.. '.', TALKTYPE_ORANGE_1)


	win = 0
	if item.uid == number_1 then
		win = win + 1 
	end
		if item.uid == number_2 then
	win = win + 1 
	end
	if item.uid == number_3 then
		win = win + 1 
	end
	

	
	if win == 1 then
			doPlayerSendTextMessage(cid, 25, "[Roll] Acertou 1.")
			doCreateItem(Bet.itemid, 1, coal)
	end
	if win == 2 then
			doPlayerSendTextMessage(cid, 25, "[Roll] Acertou 2.")
			doCreateItem(Bet.itemid, 2, coal)
	end
	if win == 3 then
			doPlayerSendTextMessage(cid, 25, "[Roll] Acertou 3.")
			doCreateItem(Bet.itemid, 4, coal)
	end
	if win == 0 then
			doPlayerSendTextMessage(cid, 25, "[Roll] Voce perdeu sua grana.")
	end
		else
		doPlayerSendCancel(cid, "Você precisa estar no piso certo.")
		return TRUE
	end
	
end
 
Its okay,
I changed the Reward for winning the Jackpot to "Christmas Tokens". (Event tokens people use to call them)
That the player can change for items =)
 
Is there any way to use multiple versions of this script? So you can have more than one casino "stall"

Im thinking with actionids but it looks complicated
 
Back
Top