Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a group/gamepass team changer?

Hey everyone I'm making a scpf game and I want to ask you guys if you can help me with something so I need a team changer which changes teams from like class D to security department but I also want like if you have 05 council gamepass or if you are 05 council in a group you can change your group from Class D to 05 but if you are Class D in a group you can only become Class D

This game is a example of what kind of team changer I want https://www.roblox.com/games/3683662946/SCPF-Area-51?refPageId=8211c71f-3d03-414a-b3ad-911a4712ed7d

1 answer

I can't write the entire script here, but what I can guide you to how you can achieve that.

1.Use an if statement to check if a player has a gamepass. 2.Do another if statement to check if a player has a rank in a group. 3.Under both these if statements, make a piece of code that switches teams.

Tips: use this following code to see if player has gamepass and is a rank in your group:

game.Players.PlayerAdded:Connect(function(player)
     if game:GetService("MarketPlaceService"):PlayerOwnsAsset("gamepassidcomeshere") then
       if player:GetRoleInGroup(numbeidrofthegroupcomeshere) == "nameofrolecomeshere" then
	--team switching code comes here
	end
  end
end)

I'm pretty convinced the correct way is using :GetRankInGroup, but I think :GetRoleInGroup works too.

This discussion is preserved as it was. New answers, comments, and votes are closed.