Z4Zy Posted September 26, 2018 Posted September 26, 2018 Hi ! Can you tell me a way to get a random player among players inside a col ? [ col refers to an area created by "createColSphere" function. ] "getRandomPlayer" function can't be use since it choose a random player from all players in the server. Any other way ?
N3xT Posted September 26, 2018 Posted September 26, 2018 (edited) tables getElementsWithinColShape math.random Edited September 26, 2018 by N3xT 2
Moderators IIYAMA Posted September 26, 2018 Moderators Posted September 26, 2018 local playerTable = {} local player = playerTable[math.random(#playerTable)] https://stackoverflow.com/questions/2988246/choose-a-random-item-from-a-table As extend of N3xT his comment. 1 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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