GUI script not working

Hello, I was working on a game and you guess emoji patterns like :fire: and :axe: and I had made about 5 questions when suddenly the script didn’t do anything, this was made in StarterGui.
Video: (Sorry for the download)
robloxapp-20211126-1928052.wmv (239.8 KB)
Script:

local p = script.Parent
local e1 = script.Parent.Parent.Emoji1
local e2 = script.Parent.Parent.Emoji2
local a = script.Parent.Parent.Answer

local fire = "fire"
local axe = "axe"
local snowf = "snowflake"
local bear = "bear"
local ant = "ant"
local trash = "put_litter_in_its_place"
local can = "canned_food"
local dog = "dog2"
local hot = "hot_face"

p.MouseButton1Click:Connect(function()
	if e2.Text == snowf then
		if e1.Text == bear then
			if a.Text == "Polar Bear" then
				e1.Text = axe
				e2.Text = fire
			end
		end
	elseif e2.Text == fire then
		if e1.Text == axe then
			if a.Text == "Fire Axe" then
				e2.Text = fire
				e1.Text = ant
			end
		end
	elseif e2.Text == ant then
		if e1.Text == fire then
			if a.Text == "Fire Ant" then
				e2.Text = trash
				e1.Text = can
			end
		end
	elseif e2.Text == trash then
		if e1.Text == can then
			if a.Text == "Trash Can" then
				e1 = dog
				e2 = hot
			end
		end
	elseif e2.Text == hot then
		if e1.Text == dog then
			if a.Text == "Hot Dog" then
				e2.Text = "hot_face"
				e1.Text = "dog2"
			end
		end
	end
end)

And yes I have tried remaking the script and retrying the game and I’m not the best at scripting so I don’t now what might be going on. I am sorry if this is the wrong place for this topic, I am also sorry if the information provided was vague.
Edit: Typos and other stuff

local p = script.Parent
local e1 = script.Parent.Parent.Emoji1
local e2 = script.Parent.Parent.Emoji2
local a = script.Parent.Parent.Answer

local fire = "fire"
local axe = "axe"
local snowf = "snowflake"
local bear = "bear"
local ant = "ant"
local trash = "put_litter_in_its_place"
local can = "canned_food"
local dog = "dog2"
local hot = "hot_face"

p.MouseButton1Click:Connect(function()
	if e2.Text == snowf then
		if e1.Text == bear then
			if a.Text == "Polar Bear" then
				e1.Text = axe
				e2.Text = fire
			end
		end
	elseif e2.Text == fire then
		if e1.Text == axe then
			if a.Text == "Fire Axe" then
				e2.Text = fire
				e1.Text = ant
			end
		end
	elseif e2.Text == ant then
		if e1.Text == fire then
			if a.Text == "Fire Ant" then
				e2.Text = trash
				e1.Text = can
			end
		end
	elseif e2.Text == trash then
		if e1.Text == can then
			if a.Text == "Trash Can" then
				e1 = dog
				e2 = hot
			end
		end
	elseif e2.Text == hot then
		if e1.Text == dog then
			if a.Text == "Hot Dog" then
				e2.Text = "hot_face"
				e1.Text = "dog2"
			end
		end
	end
end)

I’d recommend just using emojis to show as images not as the values themselves. I also merged the conditionals into a single conditional chain and replaced :connect() with :Connect() as the former is deprecated.

1 Like

try print the value that is actually an answer.

1 Like

I’ve tried it and it doesn’t let me do the first one

Type “bear” into box 1 and “snowflake” into box 2 then press the button. I noticed a.Text is never being changed, is that intentional (even though you’re checking the text inside it)?

1 Like

I thought of changing that but I forgot.
Also a.Text is supposed to be the answer for the combination.