KM_Rose Posted October 18, 2010 Posted October 18, 2010 Hi all. I know how use this math.random , i'm using it on pickups for chage the skin Example: math.random ( 56, 60 ) (skins id 56...60) But i want know if i can use it selecting independents skins: For example: i don't want skins 56...60, i want random between skin: 56, skin:58 and skin: 60... how could i use it?? some like this?? math.random ( 56. 58. 60 ) Sorry my bad english, i use examples because i don't speak english so good... some help?
12p Posted October 18, 2010 Posted October 18, 2010 Is easy. Use this: local skinSelect = math.random(0,2) if skinSelect == 0 then skin = 56 elseif skinSelect == 1 then skin = 58 elseif skinSelect == 2 then skin = 60 end setPedSkin (ped,skin)--USE A PED ELEMENT!
dzek (varez) Posted October 19, 2010 Posted October 19, 2010 more efficient way: allowedElements = { 56, 58, 60, 65, 67, 80, 91, 105 } random = allowedElements[math.random(1, #allowedElements)] setElementModel (ped, random) -- you should use it instead of setPedSkin ! Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
12p Posted October 19, 2010 Posted October 19, 2010 Difference between setElementModel and setPedSkin, why to use setElementModel? Isn't the same thing anyway?
DiSaMe Posted October 19, 2010 Posted October 19, 2010 setElementModel can be used not only on peds and players, but also on objects and vehicles. setPedSkin is deprecated. -
dzek (varez) Posted October 19, 2010 Posted October 19, 2010 https://wiki.multitheftauto.com/wiki/SetPedSkin read that information on red background Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now