• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Item] An amulet when you click on it gives a random addon

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Hello, can someone make an script for an amulet that when you click on it gives a random addon and then it dissapear...


Thanks!
 
i dont know how to do it atm but ill give you tips , you need to use an function which is onClick or something then make:
LUA:
random_addons = {
{Addons goes here},
{Addons goes here}
}
then in function:
LUA:
            for i = 1, #random_items do
                item = random_items[i]
 
Hello, can someone make an script for an amulet that when you click on it gives a random addon and then it dissapear...


Thanks!

Code:
function onUse(cid, item, fromPosition, toPosition)
    local list = maleOutfits
    if getPlayerSex(cid) == 0 then
        list = femaleOutfits
    end

    doPlayerAddOutfit(cid, list[math.random(1, #list)], math.random(1, 2))
    doRemoveItem(item.uid)
    return TRUE
end

Should work.
 
Wow that's nice!
But... how to do that gives a random addon female or male and it show a message in wich addon it gaves?
And how to do that check player addon, and don't regive?
 
Last edited:
Double UP!
Someone could fix the script with:

How to do that gives a random addon female or male and it show a message in wich addon it gaves?
And how to do that check player addon, and don't regive?
 
Can someone repair it with


How to do that gives a random addon female or male and it show a message in wich addon it gaves?
And how to do that check player addon, and don't regive?
 
Back
Top