boro Posted November 16, 2013 Posted November 16, 2013 Hi all i try set math.random for clothes but this don't work.. Please help, what is bad "CONSOLE IS CLEAR".. THIS IS FOR SPAWN PLAYER EVENT.. addPedClothes ( math.random ( skinped, "player_torso", "torso", 0 ) or ( skinped, "vestblack", "vest", 0) )
tosfera Posted November 16, 2013 Posted November 16, 2013 math.random returns an random int between 0 to 1. You've to give 2 parameters to it to get another int, since you are giving a int, 2x string and 1x int again. It will never work. Split the 2 functions; local rand = math.random ( 0, 2 ); addPedClothes ( player, "player_torso", "torso", rand );
Tete omar Posted November 16, 2013 Posted November 16, 2013 math.random is a numeral function not for strings. Here you go: local Shirts = { { "player_torso", "torso" }, { "vestblack", "vest" } } local Texture, Model = unpack ( Shirts [ math.random ( #Shirts ) ] ) addPedClothes ( skinped, Texture, Model, 0 )
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