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

Problem with this Script

Piltrafa

Active Member
Joined
Nov 10, 2010
Messages
654
Reaction score
29
Hello

I have a problem with this script, when i have gold nugget on arrow slot it appear: Você precisa estar no piso certo.

PHP:
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

Can anyone check and fix it?
Repped, thanks.
 
Você precisa estar no piso certo = You need to be right on the floor
 
Back
Top