Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Trying to make a script that Destorys a certain GUI based on your team, not sure why it dosent work?

local plr = game.Players.LocalPlayer

while true do
------------No Touch Nor Flavlor :)--------------------------------------------------------
	if plr.TeamColor==BrickColor.new("White") then
		plr.PlayerGui.Audio:Destroy()
	end
end

1 answer

###You should not check for things like that with a while loop. Use a Changed event.

local plr = game:GetService("Players").LocalPlayer

plr:GetPropertyChangedSignal("TeamColor"):Connect(function()
    if plr.TeamColor == BrickColor.White() then
        plr.PlayerGui.Audio:Destroy()
    end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.