script.Parent.Touched:connect(function(HIT)
local h = HIT.Parent:FindFirstChild("Humanoid")
if h then
local Player = game.Players:WaitForChild(HIT.Parent)
Player.PlayerGui['Finish GUI'].Frame.Visible = true
end
end)
gui wont popup when i touch a part?
3 answers
Some things to note:
###Server Scripts and PlayerGui
Now that FilteringEnabled is mandatory, it's restrictions are now in place. One of these is a change to what Server Scripts can see.
A Server Script can see the player's PlayerGui, but cannot edit it's contents. The only exception is if it is parenting an object to it, then it can edit it freely.
How do we get around this? There are a couple ways. You can try putting this script into a LocalScript, and parenting it to the player's PlayerGui. Or you can use a RemoteEvent to change the player's gui.
###connect vs Connect
connect is deprecated. It is not recommend to use deprecated for many reasons, such as:
- Deprecated items may be removed at any time
- Items are usually deprecated because there is a better way of doing something
- It may be outdated
- It is bad practice
You should instead use Connect.
The Answer is Remote Event. What this does is connects the Server to the Client, allowing you to use PlayerGui from the Server Side (Sort of). To Do this, first make a Remote Event in Replicated Storage, as the Server and Client can both see this. Name it whatever you want, for this example i'll be naming it "TouchedEvent"
There should be a Server Script (Normal Script) in what you want touched, and a LocalScript in StarterGui. Script as followed
Server:
script.Parent.Touched:Connect(function(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h then
local plr = game.Players:WaitForChild(hit.Parent)
game.ReplicatedStorage.TouchedEvent:FireClient(plr) -- Fires RE
end
end)
Local:
game.ReplicatedStorage.TouchedEvent.OnClientEvent:Connect(function() -- Sees that the event has been fired
local plr = game.Players.LocalPlayer
plr.PlayerGui['Finish GUI'].Frame.Visible = true
end)
I guess you did something wrong in it,or you removed the Part.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
The server cannot access PlayerGui's descendants unless said descendants were placed by the server. You will want to handle Touched on the client or use remote events. And connect is deprecated, switch to Connect.
try using remote events to make the gui pop up the local side
i updated