Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How Would I Make Filtering Enabled Work With GUIS?

I've been messing around with scripts in guis with fe, but I cant get them to work? Is it because the playergui is local?

--script
wait(2.5)
script.Parent.Script.Event:Fire()

--local script
script.Event.Event:connect(function()
	print('yup!')
end)

These are both located in the playergui, and it seems to work in studio but not in the actual game.

2 comments

0

This wiki article is pretty good at explaining it: http://wiki.roblox.com/index.php?title=Building_Games_with_Filtering_Enabled

2

:connect is deprecated

1 answer

You are using :Fire(), which means you're using a regular old BinadableEvent instead of a RemoteEvent. If that's the case, then use a RemoteEvent instead. BindableEvents are meant for communication between the scripts running on the server or the same client, whereas RemoteEvents are meant for client-server communication.

To fix your script, you have to replace Event with a RemoteEvent, and then call :FireClient(player) from the server instead, where player is the Player object (not the name!) of the player you want to send the event to. You can also do :FireAllClients() to send the event to all clients connected to the server.

Read the docs!

This discussion is preserved as it was. New answers, comments, and votes are closed.