~Funky~ Posted August 31, 2013 Share Posted August 31, 2013 Buenas Tengo Un Problema El Cual Consiste Que Al Apretar El Boton Me De El Skin 1 y Si Lo Vuelvo Apretar Me De Otro Skin (Random), El Problema Es Que No Se Como Puedo Hacer Eso, ya Que Quiero Que Me De Solamente 4 Skins Alealtorios, Me Podrian Ayudar:( addEventHandler("_terro",root, function() if getPlayerMoney(source)>=5000 then setElementModel(source,1 ) ----Aca no Se Que Colocar :c takePlayerMoney(source,5000) triggerClientEvent(source,"compr",root) else triggerClientEvent(source,"msjerror16",root) end end) Link to comment
Castillo Posted August 31, 2013 Share Posted August 31, 2013 Crea una tabla con los skins y luego usa math.random para obtener uno aleatorio de esa tabla. Link to comment
Alexs Posted August 31, 2013 Share Posted August 31, 2013 local skins = { 2, 4, 24, 9} addEventHandler("_terro",root, function() if getPlayerMoney(source)>=5000 then setElementModel(source, skins[math.random(1, #skins)] ) takePlayerMoney(source,5000) triggerClientEvent(source,"compr",root) else triggerClientEvent(source,"msjerror16",root) end end) Prueba eso. Link to comment
~Funky~ Posted August 31, 2013 Author Share Posted August 31, 2013 Funciono Muchas Gracias A Los Dos Link to comment
Recommended Posts