Anyone know why this script wont output the surface gui from the team color? it outputs the players name but wont continue
This is for a tool and if you click on someone it will give you their name and depending on what team they're in it will output a text box
the If function at line 35 is where the problem occurs, it also happens for the other functions
--client
local player = game.Players.LocalPlayer
local tool = script.Parent -- lets say this was the tool
tool.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
script.parent.Process:Play()
script.Parent.Display.SurfaceGui.INFECTED.Visible = false
script.Parent.Display.SurfaceGui.CLEAR.Visible = false
script.Parent.Display.SurfaceGui.IMMUNE.Visible = false
script.parent.Clear.Transparency = 1
script.parent.Immune.Transparency = 1
script.parent.Infected.Transparency = 1
script.Parent.Processing.Transparency = 0
wait(0.5)
script.Parent.Processing.Transparency = 1
wait(0.5)
script.Parent.Processing.Transparency = 0
wait(0.5)
script.Parent.Processing.Transparency = 1
wait(0.5)
script.Parent.Processing.Transparency = 0
wait(0.5)
script.Parent.Processing.Transparency = 1
wait(0.5)
script.parent.Process:Stop()
script.parent.Clear.Transparency = 1
script.parent.Immune.Transparency = 1
script.parent.Infected.Transparency = 1
if mouse.Target then
for _,v in pairs(game.Players:GetPlayers()) do -- literate through all the players
script.Parent.Display.SurfaceGui.NAME.Text = v.Name
if v.TeamColor == ("Bright red") then
script.parent.Infected.Transparency = 0
script.Parent.Display.SurfaceGui.INFECTED.Visible = true
break
end
if v.TeamColor == ("Black") then
script.parent.Clear.Transparency = 0
script.Parent.Display.SurfaceGui.CLEAR.Visible = true
break
end
if v.TeamColor == ("White") then
script.parent.Clear.Transparency = 0
script.Parent.Display.SurfaceGui.CLEAR.Visible = true
break
end
if v.TeamColor == ("Navy blue") then
script.parent.Immune.Transparency = 0
script.Parent.Display.SurfaceGui.IMMUNE.Visible = true
break
end
end
end
end)
end)

1 comment
Yeah tried this but it didn't work, I have posted the full script and that actually does work and gets the players name but still cannot find a way for the if function to make sure the players TeamColor is a certain color