Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Changing a players team on touch?

Asked by 5 years ago

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?

0
Maybe you don't need to use script. You can go to properties and set the team color and true the AllowTeamOnTouched. Xapelize 2658 — 5y
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 taxicar24 19 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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.

0
use this link for the picture https://ibb.co/3BkwV6W clash_ofsss 14 — 5y
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 ;) taxicar24 19 — 5y
Ad
Log in to vote
0
Answered by
Azarth 3141 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

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)

Answer this question