Part that gives you a rank

Hello! I need help making a script but if you touch part in the workspace called: AG.

What I have tried

I have tried using chat GPT, but that did not work.

The purpose of the script

The purpose of the script is if you touch the part, it puts you in a rank because it’s an obby.

(I know that you can use a spawn point.)

1 Like

how do you want the players to know what rank they are in? You need to specify that. Also is this does the rank progress as each stage is completed? You explanation of rank is too vague

1 Like

I’m sorry I was too vague. Basically it is the end of the game, the team is called Admin.

BTW: I’m using teams.

oh i see so at the end of the obby which is triggered by touching AG you give the player a rank im assuming. Is rank determined by the speed in which they complete the obby?

It’s given to each individual player when they reach the end.

oh so they are all given the same rank, got it will anything else happen after they get this rank?

Ok the play spawn in to the game and he was playing with his friend. They decide they wanna race, the friend is now at the end so he get the put on the team, a minute later, the player reaches the end, and also now gets put on the team.

(sorry if that does not make any sense.)

Here’s an outline:

local Players = game:GetService("Players")

local part = script.Parent

part.Touched:Connect(function(hit)
    local player = Players:GetPlayerFromCharacter(hit.Parent)
    if not player then return end

    player.TeamColor = BrickColor.new("[the name of your admin team's brick color here]")
end)

I assume you’ve already made the team, if not, there are tutorials that can explain that.

You put the code in a Script inside your part.

Also, if you can’t figure out the code, you can just use a SpawnLocation to do the same thing. If you go into properties, you can set AllowTeamChangeOnTouch to on/true and set the team color to your admin team’s color. The players will also spawn at the part.

3 Likes

Where do I put the script? So it works.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.