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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…