Mikii
Active Member
- Joined
- Mar 28, 2013
- Messages
- 197
- Reaction score
- 46
How would I know if the value (6) three times on dice ?
I don't find the logic for this on lua script.
No is possible?
EDIT
I just found the logic of how I can do this.
Just check the itemEx equals 5797. If true, then add 1 more to a storage until you get to three, otherwise add 0, and all back to start again.
SOLUTION
Close ths thread.
Sorry my Inlgish.
I don't find the logic for this on lua script.
No is possible?
EDIT
I just found the logic of how I can do this.
Just check the itemEx equals 5797. If true, then add 1 more to a storage until you get to three, otherwise add 0, and all back to start again.
SOLUTION
PHP:
local storage = 123456
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
local dice = Item(item.uid)
local dicePosition = dice:getPosition()
local value = math.random(1, 6)
local isInGhostMode = player:isInGhostMode()
if isInGhostMode then
dicePosition:sendMagicEffect(CONST_ME_CRAPS, player)
else
dicePosition:sendMagicEffect(CONST_ME_CRAPS)
end
if value == 6 then
if player:getStorageValue(storage) == -1 then player:setStorageValue(storage , 0) end
player:setStorageValue(storage , (player:getStorageValue(storage) + 1) )
else
if player:getStorageValue(storage) ~= 3 then
player:setStorageValue(storage , 0)
end
end
player:say(player:getName() .. " rolled a " .. value .. ".", TALKTYPE_ORANGE_1, isInGhostMode, 0, dicePosition)
dice:transform(5791 + value)
return true
end
Close ths thread.
Sorry my Inlgish.
Last edited: