Surface Gui Not Working

STUDIO SURFACE GUI NOT RESPONDING TO MOUSE BUTTON 1 CLICK!

Im making a little big planet game, but the surface gui is not responding, even tho its supposed to.

I dont know if this is a studio or camera issuse because theres no error but it doesnt visiblify the ui in the players playergui, and i tried everything and it doesnt work.

  • HERES THE SCRIPT!

local plr = nil

game.ReplicatedStorage.PlrUsingPc.Event:Connect(function(player)
	
	plr = player
	
end)

game.ReplicatedStorage.PlrStoppedPc.Event:Connect(function(player)

	plr = nil

end)



script.Parent.SurfaceGui.ButtonProfile.MouseButton1Click:Connect(function()
	
	if plr ~= nil then
		
		if plr:FindFirstChild("MainUI") then
			
			if plr.MainUI:FindFirstChild("CampaignGui") then
				
				plr.MainUI.CampaignGui.Visible = true
				
			else
				
				print("no campaign")
				
			end
			
		else
			
			print("no main ui")
			
		end
		
		else
		
		print("no player")
		
	end

end)

IMPORTANT NOTICE!!! IT PRINTS “no main ui”

1 Like

Oye sorry but i used remote events and now it works!

oh and you were right! thx for the help anyway :smiley:

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