I’m trying to make a proximity prompt that only appears if a player is in a certain team. I built a hitbox around the proximity prompt and if a player on team blue touches it, the proximity prompt gets visible. If a player on team red touches it, it disappears. The problem is if the player is on blue team it prints “Red”. If a player on red team touches hitbox, it also print “Red”. The color on teams is right, blue = Really blue Red = really red.
here’s the script:
Hitbox.Touched:Connect(function(hit)
if hit then
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
if player.TeamColor == BrickColor.new("Really red") then
print("Red")
proximityPrompt.Enabled = false
elseif player.TeamColor == BrickColor.new("Really blue") then
print("Blue")
proximityPrompt.Enabled = true
end
end
end
end)