Script is not working

This script is meant to make a gui come up if the answer in a text box is right or not. I have changed things around but it still does not work. No errors have came up both in the script and output, if possible please help:

I also have the script in the text box if that helps

This probably won’t be the solution, but you could put your answer variable in quotations

answer = "1939"

2 Likes

I tried it but it still dosent work thanks for the suggestion though.

Starter GUI is a child of the game and has no effect on what the player is currently visualizing. Instead, you would use a player’s PlayerGui. (Reference Link)

1 Like

The script still does not work.

What is your current script now that it is edited? It’d be easier to send as a code block rather than an image.

1 Like

Actually nvm I got it working thanks anyway I forgot to change the guis names stupidly…

Everything in starterGui gets copy to PlayerGui

Instead Trying using 
local PlayerGui = game.Players.LocalPlayer.PlayerGui

local answer = 1393

function Correct()

    PlayerGui.Correct.Enabled = true

end

function Wrong()

    PlayerGui.Wrong.Enabled = true

end

if PlayerGui.ScreenGui.TextBox.Text == tosring(answer) then

    Correct()

    if not answer then

        Wrong()

    end

end
1 Like

It does not matter if it is a local or global function because he defined it in the main scope.

1 Like