Auto team works for everyone else weather that be they are in a regiment or if they are in HQ but if they are supposed to be on the Recruit team or on the British army team they just spawn on a random regiment team (such as PARAS). I have no clue why this could be happening as it works for everyone else who isn't in a regiment.
Please help
#Auto Team
1 messages · Page 1 of 1 (latest)
@grave locust which one is recruit and which one is british army
wat if a player is in more than 1 group 
Yea thats what im thinking aswell
cause if the recruit and british army is further down the elseifs, then if a player is in a group thats before that, itll just set it to that and move on
Line 2 and line 3 are british army and line 9 is recruit
where exactly are you checking for "rec"
"rec" and "rank" will be the same variable btw
Which ones of the if statements is supposed to apply "recruit" and which is supposed to apply "british army"?
@chrome delta line 19 is for recruit and line 22 is for british army. Do you have any Idea why this could be happening?
wat if a player is in more than 1 group?
They can't be, I have manual accept on
** You are now Level 1! **
it's going to go by the order your if statements
did you write this code yourself or did you get it from someone else or ai or tutorial or whatnot?
I bought it on Built by bit
did you change all the group ids?
what is RIC?
Royal Intelligence Corps
no i meant what is it in the code
I just realised its not there but thats an easy fix and thats not the issue
do you have any idea as to why they automatically spawn on the wrong team unless they are in a regiment?
it's going by the order and arrangement of your if statements, maybe the conditions are wrong or out of order somewhere
or you put the right ids into the wrong variables
They are all correct that was the first thing I tried
But PARAS isn't before REC in any of the statements?
rec (not REC since this doesnt appear in the code), also only appears in this code exactly once - you have it, and do nothing with it
there's RE but no REC
this is not relevant
Yes but rec is the group rank equivalent to 1 as shown on line 20
So that should work
and British army personnel is shown on line 23
So I don't know where I've gone wrong
do you understand how if statements work?
Not really sorry
The basic if statement tests its condition. If the condition is true, then Luau executes the code between then and end.
You can use an elseif statement to test for additional conditions if the if condition is false. You can use an else statement to execute code if all if and elseif conditions fail. The elseif and else parts are both optional, but you can't use either without an initial if statement.
In a chain of if, elseif, and else conditions, Luau tests conditions from top to bottom, stops at the first true condition, and executes the code that follows it.
if 2 + 2 == 5 then
print("Two plus two is five") -- Doesn't print because the condition is false
elseif 2 + 3 == 5 then
print("Two plus three is five") -- Two plus three is five
else
print("All conditions failed") -- Doesn't print because the previous condition is true
end
So what do I change?
Do I chnage both the if statements to elseif?
I've got no money
we're here to help, not spoonfeed you free code
Thats not what I'm asking
I'm just wondering if making that chnage will then make the teams work
** You are now Level 2! **