Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Team script, having errors! Can someone please help?

Asked by
Regate 0
10 years ago

I've recently been trying to script a team thing for my group, but every time I test it with my friends, we always are on random teams that are not correct.

Yes, the people I test with are in the stuff required for this to work.

Can someone help me fix this?

plr = game:GetService("Players")
teams = game:GetService("Teams")
name = plr.Name

if plr:GetRankInGroup(1112405) <= 13 then
    teams == "TEST"
end
if plr:GetRankInGroup(1112405) >= 12 then
    teams == "DTRA"
end
if plr:GetRankInGroup(1112405) == 0 then
    teams == "Visitors"
end

The error is on this part:

if plr:GetRankInGroup(1112405) <= 13 then
    teams == "TEST"
end

1 answer

Log in to vote
1
Answered by 10 years ago

Replace the thing with this.

if plr:WaitForChild("Character").Parent:GetRankInGroup(1112405) <= 13 then
0
Thanks. Regate 0 — 10y
Ad

Answer this question