I have a script that will print something if a part is stepped on. The object has to have a humanoid to make sure it's a player, and the player has to be on the right team to print it. Here it is, can someone please point out the errors and how to fix it? It won't work (of course.)
local RanksAllowed = {team1,team2,team3}
local debounce = false
local team1 = game.Teams.Team1
local team2 = game.Teams.Team2
local team3 = game.Teams.Team3
print(RanksAllowed[2])
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Humanoid ~= false then
local function findPlayerTeam(player)
local player = player
print(player.Team)
end
if findPlayerTeam(hit.Parent).Team == RanksAllowed then
print("duck, quack quack")
end
end
end)

3 comments
Okay, thanks! But it's printing even if I'm on the incorrect team.
yea i noticed the team was assigned different than what I was in. seems like roblox messed the team system up
Oh.