Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Making the background green if value == 1?

Asked by
RoyMer 301 Moderation Voter
9 years ago
local player = game.Players.LocalPlayer 
local SureSave = script.Parent.Parent.Parent.Parent.HatSureBackground.HatSure.SureSave

function Click()
script.Parent.Parent.Parent.Parent.HatSureBackground.HatSure.Frame.TextLabel.LocalScript.Disabled = true
wait(.1)
SureSave.Value = script.Parent.Parent.Name
script.Parent.Parent.Parent.Parent.HatSureBackground.HatSure.Frame.TextLabel.LocalScript.Disabled = false   
script.Parent.Parent.Parent.Parent.HatSureBackground.Visible = true
end
script.Parent.MouseButton1Down:connect(Click)

How can I add this to it to happen even when the button is not clicked?

if player.ds:FindFirstChild(SureSave).Value == 1 then
script.Parent.BackgroundColor3 = Color3.new(16/255,134/255,46/255)
end

Answer this question