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

Lua Math random

Lais Prad

Disgusting Scammer
Joined
Apr 12, 2017
Messages
153
Solutions
6
Reaction score
15
How to use math:random for summon a random boss?

tfs 1.2
 
Lua:
local monsters = {[xxx] = "rat", "dragon", "demon"}
function onUse(player, item, fromPosition, itemEx)
    local position = player:getPosition()
    local gift = monsters[math.random(#monsters)]
    local monster = Game.createMonster(gift, position)
    position:sendMagicEffect(CONST_ME_MAGIC_RED)
    item:remove(1)
    return true
    end

example for action and item ID > xxx
 
Back
Top