• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

This is a fun script for players

Rugged Mage

Lua Scripter
Joined
Mar 8, 2010
Messages
1,182
Solutions
2
Reaction score
74
I just made this script for fun, players can use this command for 30k and get random items. I'm thinking about adding a remove soul part to it, so players wouldn't just sit all day using this command :p.
Code:
-- Made by Rugged Mage using QtLua Pad
local items = {2195, 2470, 2472, 2520, 2439, 2241} -- add any items you want in this.
function onSay(cid, words, param)
    local randomChance = math.random(1, 6) -- if you have more than 6 items, change 6 to the number of items you have
    if getPlayerLevel(cid) >= 125 and getPlayerMoney(cid) >= 30000 then
        doPlayerRemoveMoney(cid, 30000)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
                    doPlayerAddItem(cid, items[randomChance], 1)
                        else
                            doPlayerSendCancel(cid, "Sorry, you cannot use this command")
            end
        return true
        end

Btw, if you have any comments or questions go ahead and ask them!
 
Try Changing
Code:
doPlayerAddItem(cid, items[randomChance], 1)
to
Code:
doPlayerAddItem(cid, math.random(#items), 1)

or this will be better
Code:
for i = 1,#items do
doPlayerAddItem(cid, i, 1)
 
Back
Top