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.
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. BindableEvent
s are meant for communication between the scripts running on the server or the same client, whereas RemoteEvent
s 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.