So right now i'm converting ALL of my scripts into filtering enabled scripts so I can have players younger then 13 or something like that. Anyways I'm doing this one script rn, which I NEED to be able to access a players gui, but it's not working in game. It works in studio though. Here is the script. Also I'm only sharing the part of the script that doesn't work!
game.ReplicatedStorage.Events.Trails.CustomTrailEvent.OnServerEvent:Connect(function(plr, guiname)
local gui = plr.PlayerGui:WaitForChild(guiname).Main.ScrollingFrame.Gamepasses.three
local input = gui.Input
end)
REMEMBER THIS IS JUST THE PART OF THE SCRIPT THAT DOESN'T WORK! Thanks!
If you need i'll give you the local script in the button.
Player=script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function(player)
game.ReplicatedStorage.Events.Trails.CustomTrailEvent:FireServer(script.Parent.Parent.Parent.Parent.Parent.Parent.Name)
end)

28 comments
The script kinda got cut of. :Connect(plr, guiname)
On the first piece of code, it hase to say "end)". You are missing the parentheses
What is line one of the localscript?
I forgot to put it there... In the script its there though.
Line one of the local script is the player.
LINE 4 of the LOCAL SCRIPT got cut off! The rest is: (script.Parent.Parent.Parent.Parent.Parent.Parent.Name)
Why do you have so many script.Parent? Why not use LocalPlayer? it’s so much faster
I thought localplayer was not allowed for filtering enabled scripts?
...It’s not allowed on the server. The client is perfectly okay. Don’t learn from those crappy youtube tutorials/old free models.
And on line 3 of your local script, it errors. The MouseButton1Click event doesn’t pass the player as a parameter, it doesn’t pass anything. Remove it.
Ok
But do you know why the script cant find the gui that is there?
You’re trying to modify the PlayerGui from the server, which is not okay.
Then how would I do this?
Because I want my game to be filtering enabled...
Should I move the script into a place where the client does it not the server?
...Just set up your GUI remote to OnClientEvent from a localscript. Don’t pass the player as a parameter. And from the server, fire the remote using FireClient(). Specify the player first, then other arguments if applicable.
Seeing your scripts, you aren’t 100% ready to make your games FE compatible. I suggest you study a little more.
Ok! I'll try it out.
Yes
Do I keep the event in RS still?
yes. this allows for easy access from both server and client. putting them in server storage only allows for server access (not that you used it), when remotes are dependent on both client and server.
Im getting an error: Argument 1 missing or nil
On this line: game.ReplicatedStorage.Events.Trails.CustomTrailEvent:FireClient()
Ok, well it works! But only in studio... So RIP 1H.
Need more detail. Can you please make a much more detailed explanation of what you're trying to achieve, and your entire code?
Its actually kinda solved, but the only problem is that the game says "FireClient() can only be accessed by server". I mean boi. That makes no scense.
Where should I put the local script incapaz? ReplicatedFirst or Starter Gui?