I am trying to check if a player is in a team when they touch a brick.
local teams = game:GetService("Teams")
local teamKids = teams:WaitForChild("Kid")
script.Parent.Touched:Connect(function(prt)
print("I got touched!")
local chr = prt.Parent
local plr = game.Players:GetPlayerFromCharacter(chr)
if prt and chr and plr then
print("The thing that touched me is a player!")
if plr.Team == teamKids then
print("The player that touched me is in the team 'KIDS'!")
end
end
end)
The output I get when I touch the brick:
I got touched!
The thing that touched me is a player!
The thing is it does not say I am in the team 'KIDS' even tho I am 100%. Can even see it in the leaderboard...
I can't seem to find what is wrong.

6 comments
i would awnser but when i do people send negative reviews and make me lose my rank..right now im in the negative 10..
Be happy. Upvoted you :P
I upvoted too
Please help...
@ Danielp533 you have been downvoted due to your bad scripts a lot of which will not work.
Can anyone answer this? Please...