GUI not enabling properly

Okay, so this function works ONE TIME, then just doesn’t work again. I don’t know why, it fires in the same way both times. It’s disabled by clicking a button which, I’ve checked, only is fired once. Anyone know what could be goin on? When i put a print statement inside the function to tell me whether the GUI is enabled, it says it is, even after waiting five seconds, but the GUI doesn’t show up and looking at its explicit properties says its not enabled. I’ve checked that its getting the right player, it is, and I’ve even manually enabled the GUI and discovered that the other properties are changing correctly. So, yeah. Dunno what’s going on here, could use some help. This is in a ModuleScript btw.

functions.CollectCake = function(cake, player)
	gui = player.PlayerGui:WaitForChild("CakeCollected")
	gui.Enabled = true
	gui.Border.CakeCollectText.Text = "You found " .. cake.Name .. "!"
	gui.Border.CakeCollectText.TextColor3 = cake.TextColor.Value
	gui.Border.CakeCollectText.TextStrokeColor3 = cake.TextColorStroke.Value
end

Some context code for firing the function

		cake.Touched:Connect(function(part)
			player = game.Players:GetPlayerFromCharacter(part.Parent)
			if player and not player.PlayerGui.Values.CollectBool.Value then
				player.PlayerGui.Values.CollectBool.Value = true
				moduleScript.CollectCake(cake, player)
			end
		end)

At what moment this value: player.PlayerGui.Values.CollectBool.Value returns to false?

NEVERMIND apparently it was some LocalScript bs going on where a local script turned off a gui and I didn’t realize that that didn’t affect servers, it’s been a while since I used studio so me goofin up something like this was inevitable :sob:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.