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

Windows Help with Action script?

Kombosabo

New Member
Joined
Jul 30, 2009
Messages
27
Reaction score
1
I'm trying to make it so that when I use the item, I get a completly random outfit with addons.
But the problem is, if I create 5 different chars and use the item the same amount of times, it always gives the same outfits in an specific order.
Is there a way to make it truly random?


PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		addons = {0, 1, 2, 3}
		outfits = {157, 153, 279, 278, 128, 136, 288, 289, 148, 144,
				   137, 129, 270, 273, 131, 139, 138, 130, 269, 268,
				   132, 140, 252, 251, 150, 146, 155, 151, 158, 154,
				   133, 141, 134, 142, 149, 145, 325, 324, 541, 542,
				   516, 514, 512, 513, 471, 472, 466, 465, 464, 463,
				   433, 432, 430, 431, 329, 328, 366, 367, 335, 336,
				   325, 324}
	doCreatureChangeOutfit (cid, {lookType = outfits[math.random(62)], lookHead = math.random(132) , lookBody = math.random(132), lookLegs = math.random(132), lookFeet = math.random(132), lookAddons = 3 } ) 
	
		
end
 
This script work?? there is no if let me edit it
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
       local addons = {0, 1, 2, 3}
        local outfits = {157, 153, 279, 278, 128, 136, 288, 289, 148, 144,
                   137, 129, 270, 273, 131, 139, 138, 130, 269, 268,
                   132, 140, 252, 251, 150, 146, 155, 151, 158, 154,
                   133, 141, 134, 142, 149, 145, 325, 324, 541, 542,
                   516, 514, 512, 513, 471, 472, 466, 465, 464, 463,
                   433, 432, 430, 431, 329, 328, 366, 367, 335, 336,
                   325, 324}
    	if doPlayerAddOutfit(cid,math.random(#outfits), #addons) then
          doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC)
       end
    return TRUE      
end
 
Back
Top