Remoteevent not sending :FireAllClients

I am trying to Fire Fireallclients with a remote event. but it just passes the line without sending it or leaving an error.
Whenever I send the line with command bar it works.
I have checked if the code stops everywhere. but it just works just fine.

here I have a copy of the file with everything removed apart from my layout
Repo file.rbxl (14.1 KB)

it doesnt recieve the event if its in a screengui apearently. i am going to test further.

3 Likes

Your repro doesn’t even work. You’re waiting on a bunch of stuff that doesn’t exist, and you’re waiting on an event that doesn’t exist.

The main issue here I believe is that the event that the server script is waiting on isn’t even fired by the client, so any subsequent code in the event isn’t fired as well.

I was unable to reproduce this error, FireAllClients is working for me, even when I pass the same arguments as you passed in this thread.

I used the following code:

Server:

local event = Instance.new("RemoteEvent")
event.Name = "Event"
event.Parent = game.ReplicatedStorage

local Tab = {
	Score = math.floor(5),
	Exp = math.floor(50)
}

event:FireAllClients(false, Tab)

Client:

local event = game.ReplicatedStorage:WaitForChild("Event")

event.OnClientEvent:Connect(function(Won, Stats)
	print("RECEIVED!")
end)

This seems to be an issue with your code. I’d recommend continuing to seek help in #development-support:scripting-support

forgot to remove some lines. uploading the new file. What that line basicly did was Start the timer whenever the user hits start. that counts down whenever it hits 0 it basicly sends if it has won or lost depending if the user has completed the map within the time.

I replaced your CoreMain script with

while wait() do
	game.ReplicatedStorage.Finish:FireAllClients(true,{})
end

And Received is properly warned in output:

image

Please invest more effort into your bug reports. This doesn’t adhere to the guidelines at all and your repro wasn’t even tested. This is almost certainly programmer error.

3 Likes

image
it did past the fireallclient event in serverscriptservice. But it diddent fire.

this is when i fire it from the commandbar


As you can see this isnt a programming error. because this should just function as normally. but it doesnt.

In your new repro file, you replaced CoreMain with this:

local Tab = {
	Score = math.floor(5),
	Exp = math.floor(50),
}
game.ReplicatedStorage.Finish:FireAllClients(false,Tab)

The ServerScript runs immediately after the server starts, so the player might not even be in the server yet!

Adding a wait(4) before the script fixes this.

1 Like

let me add that to the repo. in my script the server waits for a Start Signal. whenever the timer hits 0 it will send results towards every player. I will wait this out see if it works tomorrow. could be an issue created by the New Lua Firmware. in my test file it was working perfectly until now. and when i go back to that testfile it doesnt work there iether

So you added a wait(5) in your repro and now Received is properly warned in the output… So where’s the bug?

1 Like

To be clear, where is this not woking? In a live game server or in Studio?

Honestly i have no clue why its working on that repo file and not in my studio file. Could be because maybe there’s something wrong on my studio side. or that the repofile is just a skinned down version

this is how the serverscript works
game.ReplicatedStorage.Start.OnServerEvent:Connect(function() --Gets the start signal from the client
wait(5) – waits 5 second
local Tab = {
Score = math.floor(5),
Exp = math.floor(50),
}
warn(“SendFrom Serverside”)
game.ReplicatedStorage.Finish:FireAllClients(false,Tab) – send the infomation to the client if he has won. This is the line that is erroing out
end)

both server and player. but as i said i will take a look tomorrow again. if its still hapening i will post it here.

dont exactly know what is wrong with this. But
image

no clue why it doesnt work in that screen gui. if i make a newone and rename it the exact same. it will work just fine.