Why doesn't the frame show when touch part

I use this Script, I put everything in the right place, but only the blur works, the frame doesn’t show. I checked the output, but there is nothing wrong there. Or no errors. Scripters out there please help me. I wanted to make so when a player touches part the certificate shows.

local Frame = script.ScreenGuiS.Frame
local Blur = game.Lighting.Blur

script.Parent.Touched:connect(function (hit)
	    Frame.Visible = true
		Blur.Size = 24
		wait(4)
	    Frame.Visible = false
		Blur:Destroy()
	end)
1 Like

Where is this script parented in? Is it a local script or server script?

1 Like

It is neither, it is a regular script in the part. Should I put it somewhere else?

1 Like

It would be better if you show me the tree diagram, like how does it look like in the workspace.

1 Like

Is your Frame a child of the part that is touched?

1 Like

maybe its because your frame is in the script who is in workspace

2 Likes
  1. Make sure your frame isn’t in workspace.
  2. Make sure that it is a normal script and not a local script.

These should fix the problems but could you show the Explorer tab so we can see exactly what the problem is?

1 Like

If you want a gui to appear on the part then use surfacegui.

1 Like

eee
I put it in the script and startergui it still doesn’t work. The Local Script is the
script.Parent.Text = " “… game.Players.LocalPlayer.Name …” "

and the script I sent is the certificate script.

1 Like

You could use remote events. Although I don’t see why it won’t work.

If you have the main script with the touch event, and the screenGuiS inside of the StarterGui then this should work, Did you change the the Frame variable to the current location so game.StarterGui.ScreenGuiS.Frame

1 Like

No I want it to appear on the screen, but thank you for your help! I tried putting it in StarterGui it didn’t work.

1 Like

Local scripts don’t run on the server, and nor do screengui’s (unless it’s a billboard or surface gui).

Have you screenGui within your StarterGui as it will replicate to your player’s gui, and you can access it there.

local Blur = game.Lighting.Blur
local Players = game:GetService("Players")

script.Parent.Touched:connect(function(hit)
	local player = Players:GetPlayerFromCharacter(hit.Parent)
	local playerGui = player:WaitForChild("PlayerGui")
	local frame = playerGui:WaitForChild("ScreenGuiS").Frame
	
	frame.Visible = true
	Blur.Size = 25
	wait(4)
	frame.Visible = false
	Blur:Destroy()
end)
1 Like

I did try putting it in StarterGui it still didn’t work.

1 Like

Yeah but did you change the location in your main script?

1 Like

Edit: I put it in StarterGui and I added his code it still doesn’t show the ui. I’ll send a video

I’m changing it, i will also try the code that Xx_FROSTBITExX

1 Like

I updated it, the frame is not showing either way. I don’t know if it is a problem with studio or not. Output showed this. script
sdfgf sdfghj

1 Like

Can you send a roblox model file?

1 Like

Well it seems that the only other reason is that the frame is off the screen in some weird position.
I’m not sure why WaitForChild is erroring, unless frame can’t be found.

1 Like

You didn’t have the screenGui enabled! Enable it then change the frame visibility.

2 Likes

You are right, It was inactive plus it wasn’t enabled. Thank you so much TheDCraft and Xx_FROSTBITExX. I will credit you under my game for your help!

1 Like