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

Team gui, Auto checks. Any help? [Still not working]

I have a script that goes inside a textbutton and its suppose to remove the text button from your screen if your team color is any other color than medium stone grey. But its not working.

Here is my script:

local gui = script.Parent
local player = game.Players:WaitForChild("LocalPlayer") 
local clonedGui 

Check = function(propertyChanged) 

if propertyChanged == player.TeamColor then  
        if player.TeamColor == BrickColor.new("Medium stone grey")  then
            gui.Visible = true 
        else 
            gui.Visible = false  
        end  
    end  
end  
Check() 
player.Changed:connect(Check) 

1 answer

✓ Accepted answer
local gui = script.Parent
local player = game.Players:WaitForChild("LocalPlayer") 
local clonedGui 

         while player.TeamColor == BrickColor.new("Medium stone grey") do
            gui.Visible = true
	    wait()
        end
	while player.TeamColor ~= BrickColor.new("Medium stone grey") do
            gui.Visible = false
            wait()
        end  

end)

While the Player's teamcolor is Medium stone grey, it will keep making the gui Visible. While the Player's teamcolor isn't Grey, it'll keep making it invisible.

Nothing much to explain.

10 comments

0

oh

0

still didnt work the way i wanted

0

what is the way you wanted it to work?

0

Well, every playr has this in starter gui, in my game you change teams from medium stone grey to red or blue, and When that happens I want the gui/frame to not be visible.

0

sorry for the messy script..

0

no its ok

0

Does it work?

0

no...

0

OutPut?

0

nothing

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