Hello, and thank you for taking your time out of your day to read this.
I am currently making a loadout system, for a group.
I posted recently today, but i still having troubles with something.
It only prints out the first one, but i want it to print out all of the player’s loadouts, and groups that they are in. I’m planning on doing something with this.
If you need anything explaining, please don’t hold back.
groupIds variable, it doesn’t save 2 values, it just gets one as long as it’s
true or anything other than
You could use this function instead:
local function PlayerIsInGroup(player: Player) : nil | number
-- this function loops through the group ids and checks if the player is in them
for _, id in ipairs(groups) do
if player:IsInGroup(id) then
-- if the player is in the current group, this returns the group id
-- this returns 'nil' as a default value
-- example usage
local x = PlayerIsInGroup(Player)
-- prints either 'nil' or '(groupid)'
Oh, so ipairs is used for searching through tables?
Never knew that, thank you!