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

Stat change the color of GUI?

I am trying to make it so that when the boolean value is false the script's parent (the GUI) will change to a bright red colour but it does not work and i don't see anything wrong with it (i am new to LUA)

https://pastebin.com/DzSksHg4 < script

1 answer

simple fix for yours your testing for a "string" you need to test for Boolean YOUR CODE:

local Hamon = game.Players.LocalPlayer.Leaderstats.IsHamon
if Hamon.Value == "false" then -- this is testing a string not a Boolean
    script.Parent.BackgroundColor3 = "Bright Red"
end

to fix it all you need to do is remove the "quotation marks" like:

local Hamon = game.Players.LocalPlayer.Leaderstats.IsHamon
if Hamon.Value == false then -- this is now testing a Boolean
    script.Parent.BackgroundColor3 = "Bright Red"
end

NOTE: please use the code block (at the top with the Lua Logo)

NOTE2: i dont know if this works: script.Parent.BackgroundColor3 = "Bright Red"

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