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

Only 2 images appear, and the other 2 dont work?

I really don't understand this one. Even when I have Egg-Head or Teamwork Bighead's value as 1 it still won't work.

local player = game.Players.LocalPlayer
local gui = player.leaderstats
script.Parent.Parent.TextButton.MouseButton1Down:connect(function()

script.Parent.Parent.TextButton.Visible = false
script.Parent.Parent.Closed.Visible = true
if gui["Welcome Bighead"].Value == 1 then
	script.Parent.VisitorBigHead.Visible = true
	
	if gui["Kirby Bighead"].Value == 1 then
	script.Parent.KirbyBigHead.Visible = true
	end
	end
if gui["Egg-Head"].Value == 1 then
	script.Parent.EggHead.Visible = true
	
	if gui["Teamwork Bighead"].Value ~= 1 then
	script.Parent.TeamworkBigHead.Visible = true


	end
end
end)

1 answer

✓ Accepted answer

You had some conditional statements inside the other conditional statements. It has to be like this:

local player = game.Players.LocalPlayer
local gui = player.leaderstats
script.Parent.Parent.TextButton.MouseButton1Down:connect(function()

script.Parent.Parent.TextButton.Visible = false
script.Parent.Parent.Closed.Visible = true
if gui["Welcome Bighead"].Value == 1 then
    script.Parent.VisitorBigHead.Visible = true
end
    if gui["Kirby Bighead"].Value == 1 then
    script.Parent.KirbyBigHead.Visible = true
    end
if gui["Egg-Head"].Value == 1 then
    script.Parent.EggHead.Visible = true
end
    if gui["Teamwork Bighead"].Value ~= 1 then
    script.Parent.TeamworkBigHead.Visible = true
 end
end)

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