The if statement I’m using isn’t working in this block of code. There are no errors in the output. I’ve tested out the rest of the code and it works fine. The problem is that nothing inside the if statement works. Plr comes from a parameter in the function that this function is in (it’s a click detector). The QuestItems instance is a folder and the Mushroom instance is a boolvalue within the folder.
plr.PlayerGui.VitoGui.DialogueOp4.MouseButton1Click:Connect(function()
local textLabel = plr.PlayerGui.VitoGui:WaitForChild("Text")
plr.PlayerGui.VitoGui.DialogueOp3.Visible = false
plr.PlayerGui.VitoGui.DialogueOp4.Visible = false
if plr.PlayerGui.QuestItems.Mushroom == false then
typewrite(textLabel, "You don't have a mushroom!")
elseif plr.PlayerGui.QuestItems.Mushroom == true then
plr.PlayerGui.QuestItems.Quest1Complete = true
typewrite(textLabel, "Good job!")
end
wait(3)
plr.PlayerGui.VitoGui.Enabled = false
plr.PlayerGui.VitoGui.DialogueOp1.Visible = true
plr.PlayerGui.VitoGui.DialogueOp2.Visible = true
end)