tarantonio
Old School Player
- Joined
- Jun 21, 2009
- Messages
- 865
- Solutions
- 1
- Reaction score
- 274
I'm looking to make dice available on 7.6 server.
I have this code for dice, but I need to transform it to work on OTHire (otserv):
Also if anyone knows how to make the item available on client/server please help me. I know that I have to modify something, but I'm lost now.
I have this code for dice, but I need to transform it to work on OTHire (otserv):
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local dicePosition = item:getPosition()
local value = math.random(6)
local isInGhostMode = player:isInGhostMode()
dicePosition:sendMagicEffect(CONST_ME_CRAPS, isInGhostMode and player)
local spectators = Game.getSpectators(dicePosition, false, true, 3, 3)
for _, pid in ipairs(spectators) do
player:say(player:getName() .. " rolled a " .. value .. ".", TALKTYPE_MONSTER_SAY, isInGhostMode, pid, dicePosition)
end
item:transform(5791 + value)
return true
end