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

Changing a players team on touch?

Ok honestly this question should be simple. Somehow I just don't know how to do this. I have looked everywhere and can't find any script that uses only 2-3 just to do this. So, I am trying to make a script where when player touches a part, he/she changes to a different team (in this case, the really red team). I want to fit this in a script that is already filled so besides the first line with the touched:connect, I need it all in a single line. Can someone help me here?

2 comments

0

Maybe you don't need to use script. You can go to properties and set the team color and true the AllowTeamOnTouched.

0

the thing is, I don't want a spawner. I don't want anyone to get spawned on it. I just need a script that changes their team and tps them somewhere else when they touch it. The only problem I have with that is when I have the first line for when they touch it, the teamcolor function won't work

2 answers

✓ Accepted answer

Hey there, it looks like you are pretty new to using Roblox studios. Don't worry, we all learn by asking questions.

Well on studios there is a neat feature that allows this without having to use any scripts.

I have provided an image link: https://ibb.co/SsFMRCC

Click on the checkbox in the red box and when you touch it you should switch teams.


If you are not sure of how to set a team spawn to change the color in the blue box to your team color.

If you have any more questions please feel free to post questions.

2 comments

0

use this link for the picture https://ibb.co/3BkwV6W

0

no I have been here for a few years. How ever, a script is the orthodox strategy for what I need. Read the comment above ;)

Even though you didn't provide an example, I had to search for a while before I find out I needed to add TeamService first, so here's how.

Top bar > Model > Service > Teams

Explorer > Teams > Add Team > Set BrickColor in Properties

-- Here's an example when joining, I'll leave it up to you to research how you'd do it with a Touched Event.

game.Players.PlayerAdded:Connect(function(player)
	player.TeamColor = BrickColor.new("Really red")
end)

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