0

I would like to know how I can do in roblox studio so that the first member that joins the blue team (it is not self-assignable) has the rank of captain.

and how i do when the captain presses that 'C' next to his teammate, that means that he will give that player the captain rank.

any idea how to do this? please

Matthew
  • 1
  • 3
  • any own ideas? break your problem down into atomic steps. what is the first thing you cannot achieve? do you know how to do someting if a player joins? how to process key input? how to interact between players? your question is way too broad. plus you do not show any own effort to solve the problem. please read [ask]. Imagine your idol is Arnold Schwarzenegger. You won't find a tutorial on how to become Arnold or yet another govenor-actor-bodybuilder-hybrid but you will find tutorials on how to make protein shakes, how to grow your biceps... put it all together and who knows, one day... – Piglet Jan 06 '21 at 07:07
  • please give the entire roblox documentation a read. you don't have to memorize every detail but you'll get a feeling of what is available/possible in Roblox. only if you know that you can properly think of solutions. – Piglet Jan 06 '21 at 07:20

1 Answers1

0

google "roblox player joins"

https://developer.roblox.com/en-us/api-reference/event/Players/PlayerAdded

The PlayerAdded event fires when a player enters the game. This is used to fire an event when a player joins a game, ...

Ok so now we know how to do something (execute code) when a player joins.

Captain

There is no such thing as a Captain in Roblox. If that is part of your game you'll have to give your player some rank attribute.

google Roblox player attribute hoping to find some help

https://developer.roblox.com/en-us/api-reference/function/Instance/SetAttribute

Looks like we do not even have to implement this ourselves!

So something like

playerInstance:SetAttribute("rank", "Captain")

should do the trick.

I have never worked with Roblox. But I know how to search the web and how to read documentations. This is what I found with 2 minutes of effort.

Break your problems down. You'll rarely find help on complex problems you came up with. But the internet is full of little bricks for pretty much anything in life.

Piglet
  • 27,501
  • 3
  • 20
  • 43
  • The Players.PlayerAdded event is fired whenever a player joins the game, but not when the player is assigned a team. Use [Team.PlayerAdded](https://developer.roblox.com/en-us/api-reference/event/Team/PlayerAdded) instead. – MJV Jan 06 '21 at 13:11
  • @MJV misread that in the OP, thanks for pointing out – Piglet Jan 06 '21 at 13:51