How to have a team with more benefits then the other team?

So I wanna make a game were 1 team(red) has more benefits then the other team(green) like that the red team walks faster then the green team (It doesn’t have to be walking, it can be like jumping higher to).

But how do I start scripting on this?

thank you for reading this and hopefully helping me

1 Like

You can just use an if statement in your script to check if the player is in a team or not.

if Player.Team == "Red Team" then
  -- player benefits

Also it’s better to use “Player.TeamColor”, I think.

Put a script inside ServerScriptService and type

game.Players.PlayerAdded:Connect(function(player)
     player.CharacterAdded;Connect(function(character)
          if player.TeamColor == "Really Red" then-- Change the name if the team color for red is different
               character.Humanoid.WalkSpeed = [Any number you want]
               -- Add other benefits here
          end
     end)
end)

That should work. Please let me know if I’m wrong

I don’t really know but doesnt in line 2 the ; have to be a :?

and even if I change that, it doesn’t work but it doesn’t give an error to?

(and sorry for the late response)

Yes, sorry about the typo. : is correct. Make sure the leaderboard shows that you are on the red team and that the team color actually is "Really Red" also change [Any number you want] to a number and get rid of the brackets.

So I tried what you said but it didn’t work
here is a video of the problem that the speed doesn’t change:
robloxapp-20210611-1940047.wmv (2.2 MB)

here is the propertie of the team:
image

and here is the code that you said

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player.TeamColor == "Really Red" then-- Change the name if the team color for red is different
			character.Humanoid.WalkSpeed = 60 -- I changed this to see the results good
			-- Add other benefits here
		end
	end)
end)

Maybe the script is outdated or do I just do something wrong?

Let me go do some testing. I’ll get back to you in a bit.

It shows the team on the player list right?

yes its doing that

image

Oh I’m so stupid :rofl::rofl::rofl:

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player.TeamColor == BrickColor.new("Really red") then-- Change the name if the team color for red is different
			character.Humanoid.WalkSpeed = 60 -- I changed this to see the results good
			-- Add other benefits here
		end
	end)
end)

ow yeah that works :smiley:
but if you go back to another team, you still get speed 60, how can i fix that?

(sorry if I ask to many questions)

Change the script to this

local TeamService = game:GetService("Teams")

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player.TeamColor == BrickColor.new("Really red") then-- Change the name if the team color for red is different
			character.Humanoid.WalkSpeed = 60 -- I changed this to see the results good
			-- Add other benefits here
		end
	end)
end)

TeamService:FindFirstChild("[Name of green team]").PlayerAdded:Connect(function(player)
	if game.Workspace:FindFirstChild(player.Name) then
		local character = game.Workspace:FindFirstChild(player.Name)
		character.Humanoid.WalkSpeed = 16
	end
end)
2 Likes

yeah it works :smiley:

Thank You Really Really Much For The Help :grinning_face_with_smiling_eyes:

1 Like