I want to let all of the local scripts in my game now I am done loading. How can I send an event, because I’m pretty sure bindable events are only server-sided, and remote events can’t go from client to client.
Have one local script fire to the server then have that server sided script fire to all of the desired local scripts.
I would recommend just firing a remote event to the server, then firing that event to the clients excluding yourself.
That won’t work, because it can cause bugs. All clients will be firing the server almost at once.
BindableEvents / Functions can work between LocalScripts as well as ServerScripts, both LocalScripts will just need a reference to the same BindableEvent. I would insert it into ReplicatedStorage, so that LocalScripts can access it easily.
Here is an example where one LocalScript gives another LocalScript a message to print out:
-- LocalScript 1
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local bindableEvent = ReplicatedStorage:WaitForChild("BindableEvent")
bindableEvent:Fire("Hello, world!")
-- LocalScript 2
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local bindableEvent = ReplicatedStorage:WaitForChild("BindableEvent")
local function OnEvent(message)
print(message) --> Hello, world!
end
bindableEvent.Event:Connect(OnEvent)
Ok but what if i only want to fire the event for a specific client? Like with :FireClient()
So, from one client to another?
For example: Player “george” and player “bob”
george doesn’t have access to bob’s localscripts, which means it should be done from the server.
george fireServer → server fireClient → bob receives