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

Problem z math.random i repeat until ponownie

klekSu

Stroke my ego.
Joined
Nov 4, 2008
Messages
1,285
Reaction score
18
Wiecie co robię źle, że outfit 135 NIE jest brany pod uwagę, a już trzy kolejne (302, 266, 75) są? Chyba tu nie ma znaczenia kolejność numeryczna? :| a może ma? :| 75, 135, 161-191, 266 i 302?

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
repeat
rnd = math.random(2, 351)
  until ((rnd ~= 135) and (rnd ~= 302) and (rnd ~= 266) and (rnd ~= 75) and (rnd < 161) or (rnd > 191))  
        for i = 1, #effects do
                doSendMagicEffect(getCreaturePosition(cid), effects[i])
        end
        doCreatureChangeOutfit(cid, {lookType = rnd, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0})
        doSendAnimatedText(getPlayerPosition(cid),"Changed!", math.random(01,255))
--	print (rnd)
return TRUE
end
 
Potwierdzam :p Warunkiem logicznego iloczynu jest ((rnd < 161) or (rnd > 191)) a nie (rnd < 161)
 
Sorx mam miażdżyce na mózgu :\ o wszystkim zapominam, a masz.
 
Back
Top