KM_Rose Posted October 18, 2010 Share 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? Link to comment
12p Posted October 18, 2010 Share 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! Link to comment
dzek (varez) Posted October 19, 2010 Share 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 ! Link to comment
12p Posted October 19, 2010 Share Posted October 19, 2010 Difference between setElementModel and setPedSkin, why to use setElementModel? Isn't the same thing anyway? Link to comment
DiSaMe Posted October 19, 2010 Share Posted October 19, 2010 setElementModel can be used not only on peds and players, but also on objects and vehicles. setPedSkin is deprecated. Link to comment
dzek (varez) Posted October 19, 2010 Share Posted October 19, 2010 https://wiki.multitheftauto.com/wiki/SetPedSkin read that information on red background Link to comment
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