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

My Rebirth Gui is not appearing even though it should be?

I have a rebirth script where whenever you click the rebirth button you rebirth ( if you have enough water) If you don't have enough coins, a gui appears saying " You need more Water ". The problem is, the gui is not appearing, I have tried transparency and Visibility.

Script:

	elseif result == "NotEnoughWater" then
		NotEn.BackgroundTransparency = 0
		Noteno.BackgroundTransparency = 0
		NotEn.TextLabel.TextTransparency = 0
		NotEn.TextLabel.Text = "You need more water to Rebirth!"
		print("Not Enough")
		wait(2)
		NotEn.BackgroundTransparency = 1
		Noteno.BackgroundTransparency = 1
		NotEn.TextLabel.TextTransparency = 1

	elseif result == "NotEnoughWater" then
		NotEn.Visible = true
		Noteno.Visible = true
		NotEn.TextLabel.Text = "You need more water to Rebirth!"
		print("Not Enough")
		wait(2)
		NotEn.Visible = false
		Noteno.Visible = false
		

The console is printing "Not Enough" like its supposed to but doesn't seem to do anything with the guis which I've even made Zindex 500.

1 answer

✓ Accepted answer

You could try using a function when dealing with Visible.

function showRebirth()
     NotEn.Visible = true
     Noteno.Visible = true
     NotEn.TextLabel.Text = "You need more water to Rebirth!"
     print("Not Enough")
     wait(2)
     NotEn.Visible = false
     Noteno.Visible = false
end

-- put the event here

elseif result == "NotEnoughWater" then
	showRebirth()
end

Or you could WaitForChild the GUI, if the gui hasn't load.

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