So, the script from the other post works (https://scriptinghelpers.org/questions/116927/touching-part-not-making-billboardgui-show-up) but now it shows the terminate text even when you're on a different team. Can someone help please?
Error Script:
terminateArea.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid")then local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) if hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible == false then if game.Players.GetPlayerFromCharacter(hit.Parent).Team == ExecuteTeam then end hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible = true -- this line of code is supposed to be in the last "if" statement I assume end end end)
Fixed Script:
terminateArea.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid")then local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) if hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible == false then if game.Players.GetPlayerFromCharacter(hit.Parent).Team == ExecuteTeam then hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible = true -- Intended placement end elseif hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible == true then if game.Players.GetPlayerFromCharacter(hit.Parent).Team ~= ExecuteTeam then hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible = false -- make the gui invisible if the visibility is set to true and the player is not on the "execute" team end end end end)