I tried to make it so ppl get teamed into a teamed after touching a part (not a spawn)
--put all the teams in a table .a table is a variable containing other variables teamBricks = { game.Workspace.RedPart game.Workspace.OrangePart, game.Workspace.BluePart } --when the player touches a team part, make the players team the team brick they stepped on. function touchedPart(hit, teamPart) local player = game.Players:FindFirstChild(hit.Parent.Name) local team = game.Teams:FindFirstChild(teamPart.Name if(player and team)then player.Team = team end end --make a touch event for each brick for i = 1, #teamBricks do teamBricks[i].Touched:Connect(function() touchedPart (TeamBricks[i]) end) end
i got it from somebody but its not working please help ~Lowmeister
This isn't a complete answer, and it may not fix it, but I have a few suggestions.
One: On the fourth line, you didn't add a comma after 'RedPart'. Two: On the fifteenth line, you don't have a closing bracket, you only have an opening one.
That's it. This might not fix it all though, just saying.
Closed as Non-Descriptive by maumaumaumaumaumua, ForeverBrown, BashGuy10, and hiimgoodpack
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?