So I've been having some trouble with my script recently. I made a part with a click detector and inserted a script into the click detector so that it would open a GUI. This is the script:
script.Parent.MouseClick:connect(function() game.StarterGui.CODEN.VERIFICATION.Visible=true end)
--CODEN is the screen GUI and VERIFICATION is the frame
Please PM my profile(YieldingSweetblade) to contact me about this. You have to follow me to message me (feel free to unfollow me once you are done).
I am pretty experienced with Filtering Enabled, so I am glad to help. Also I have tested this in Filtering Enabled an it is working!
First of all you need to create a script, I recommend putting it inside "ServerScriptService", Next you need to create a "Remote Event" inside of "ReplicatedStorage" Name the Remote Event: "ShowGui"
Now copy this:
local part = game.Workspace.PARTNAMEHERE local rstorage = game:GetService("ReplicatedStorage") local showgui = rstorage.ShowGui part.ClickDetector.MouseClick:connect(function(player) showgui:FireClient(player) end)
Next, create a LocalScript inside of your ScreenGui.(make sure it is in ScreenGui, NOT a frame.) Now copy this code:
local rstorage = game:GetService("ReplicatedStorage") local showgui = rstorage.ShowGui showgui.OnClientEvent:connect(function() script.Parent.Enabled = true end)
If you still need help, contact me. (I have Discord)
Your script only makes that GUI Visible as a StarterGui. StarterGui is basically a Gui that is always shown on the players screen as it is set in the StarterGui. So, you're gonna need to access the player's PlayerGui and make it visible from there.
You should do..
script.Parent.ClickDetector:Connect(function(plr) plr.PlayerGui.CODEN.VERIFICATION.Visible = true end)
Thee's answer is right but it wouldn't fit for FilteringEnabled purposes. You can insert a LocalScript to Gui and give a specific name to object holding ClickDetector. Tben do the connection. Example for a localscript inside ScreenGui:
game.Workspace.SPECIFICNAME.ClickDetector.MouseClick:Connect(function() script.Parent.VERIFICATION.Visible = true end)
Although, this would be more efficient but not the most because finding an object via game.Workspace is not a good way to find something. Using a remote to fire an event when it have been clicked or sending itself as an object variable as a parameter by firing an object after character spawns for this kind of thing would be better but it's confusing for beginners. Research it when you feel ready. Until that, use this.