FireAllClients() Not working?

Hello, I would like to achieve a client sided script to handle things such as visual effects, animations, and many other things.

Although I have run into an issue. For some odd reason FireAllClients does not work. I have a local script inside of SCS that uses a keybind to fire a remote to a server script, said server script receives the remote and works fine but when I try to fire a remote to the client from said script it won’t print from the client. I have tried from scratch following a tutorial one by one to see if I was doing something wrong but nothing works.

Server Script

local Remotes = game.ReplicatedStorage.Remotes
local RasenganRemote = Remotes.UzumakiCombo
local ClientRemote = Remotes.Client.UzumakiCombo

RasenganRemote.OnServerEvent:Connect(function(player)
print("A") -- Prints
local model -- this is for the hitbox, which I didn't include in this post.
ClientRemote:FireAllClients(player, model)
print("B") -- Prints
end)

Local Script

local Remotes = game.ReplicatedStorage.Remotes
local ClientRemote = Remotes.Client.UzumakiCombo
local rockmod = require(game.ReplicatedStorage.Modules.RockModule)
local mod = require(game.ServerScriptService.RagdollModule)


ClientRemote.OnClientEvent:Connect(function(plr, Enemy)
     print(plr) -- doesnt print
     print(Enemy) -- doesnt print
     print("Uzumaki Combo Client") -- doesnt print
end)

I’ve had this problem for a very long time now. I really wish I could find a fix

can you say what is Local Script parented it ?

if you put a print() thing after the local mod = ... bit, does it print?

The RemoteEvent isn’t detecting any request(s) from the server. This may be due to the server not sending a request to the client, or the client itself is not receiving it with anything.

Make sure the variable(s) which states the ‘RemoteEvent’ is an actual path. Maybe try using :WaitForChild() to make sure everything loads in correctly. e.g:

local Remotes = game.ReplicatedStorage:WaitForChild("Remotes", 100) :: Folder?

This is probably due to the RemoteEvent not loading in time for the LocalScript as it’s replicating itself to clients.

It is generally good practice to use :WaitForChild() when indexing things on the client.

Try this:

local Remotes = game.ReplicatedStorage:WaitForChild("Remotes")
local ClientRemote = Remotes.Client:WaitForChild("UzumakiCombo")
local rockmod = require(game.ReplicatedStorage.Modules:WaitForChild("RockModule"))
local mod = require(game.ServerScriptService.RagdollModule) -- this wouldn't work


ClientRemote.OnClientEvent:Connect(function(plr, Enemy)
     print(plr) -- doesnt print
     print(Enemy) -- doesnt print
     print("Uzumaki Combo Client") -- doesnt print
end)

Assuming this is done on a LocalScript(which should be) RagdollModule wouldn’t work as ServerScriptService is only accessible through the server(normal scripts)

1 Like

I think that putting a local script inside a ServerScriptService where it is especially for server scripts only may not be a good idea, you might want to parent them (local scripts) in a starter character/player script folder so it can be ran properly in the client side

1 Like

Like other people have said, it’s probably got something to do with the fourth line.

I parented the local script to SCS and it worked :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.