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

ImageButton won't go transparent after a if statement?

Asked by 6 years ago

what i'm trying to do is, when the client clicks the arrow a bunch of imagebutton turns transparent and different imagebuttons turns visible. and i'm checking if the Dreamy Black Hair is visible which it was when i tested it, but the arrow icon didn't turn transparent!


repeat wait() until game.Players.LocalPlayer.PlayerGui ~= nil --//GUIs local HairGui = game.Players.LocalPlayer.PlayerGui:WaitForChild("HairGui") --//Main script.Parent.MouseButton1Down:Connect(function() HairGui["Beautiful Hair for Beautiful People"].Visible = false HairGui["Black Scene Hair"].Visible = false HairGui["Black Swoosh Hair"].Visible = false HairGui["Red and Black"].Visible = false HairGui.Shaggy.Visible = false --//Next Row HairGui["Dreamy Black Hair"].Visible = true HairGui["Animazing Hair"].Visible = true HairGui["Roblohunk Hair"].Visible = true end) --// Main Issue if HairGui["Dreamy Black Hair"].Visible == true then HairGui:WaitForChild("ArrowKey").Visible = false end

1 answer

Log in to vote
0
Answered by 6 years ago
repeat wait() until game.Players.LocalPlayer.PlayerGui ~= nil

should be

repeat wait() until game.Players.LocalPlayer:FindFirstChild("PlayerGui") ~= nil
if HairGui["Dreamy Black Hair"].Visible == true then
    HairGui:WaitForChild("ArrowKey").Visible = false
end

should be inside of the MouseClick event

Ad

Answer this question