GUI script functions but nothing shows up

I was making a script just now that basically increases the blur size locally and shows a imagelabel along with a close textbutton. Looking at the properties window, the script does seem to work but I don’t see anything.

local script inside ReplicatedFirst

local remoteEvent = game.ReplicatedStorage:WaitForChild("RemoteName")
local MainFrame = game.StarterGui.ScreenGui.ImageLabel
local Blur = game.Lighting.Blur
local Button = game.StarterGui.ScreenGui.TextButton

remoteEvent.OnClientEvent:Connect(function()
	for i = 0,24,1 do
		Blur.Size = i 
		wait(0.05)
	end
	Button.Visible = true
	MainFrame.Visible = true
	MainFrame:TweenPosition(UDim2.new(0.5, -157 ,0.387, -157),"Out","Quint",1,true)
end)

Local script inside textbutton

local MainFrame = game.StarterGui.ScreenGui.ImageLabel
local Blur = game.Lighting.Blur
local Button = script.Parent

Button.MouseButton1Click:Connect(function()

	for i = 24,0,1 do
		Blur.Size = i 
		wait(0.05)
	end
Button.Visible = false
	MainFrame:TweenPosition(UDim2.new(0.5, -157 ,3, -157),"Out","Quint",1,true)
	wait(5)
	MainFrame.Visible = true


end)

image
image
image

You have to reference the LocalPlayers’s PlayerGui, not the StarterGUI.

What’s the exact reference line?

It should work but it doesn’t and it outputs this message
image

Use a WaitForChild. Some UIs won’t load immediately so you have to do that.

It worked! thank you so much for helping!

1 Like