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

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

Asked by
7_c 37
6 years ago
Edited 6 years ago

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

Log in to vote
1
Answered by
Asceylos 562 Moderation Voter
6 years ago
Edited 6 years ago

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)

Ad

Answer this question