Fireallclients not fireing from the serverside

Hello, I am trying to send some information to display to the client after a Round has been finished. but for some reason, it doesn’t send anything. it but the script does go past the line without error.

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

it does work when i paste this line in command bar. but not in the server script
This script is located in ServerScriptService.

this is probably an roblox issue. and nothing with my code

2 Likes

well,arent you setting to false,Then defining Tab?image

Hmm, doesn’t seem to be an issue with the code, I’d recommend posting in Engine bugs.

2 Likes

have both tried sending no information towards the client but still passes the line without doing anything and not erroing out

Ok idk,rlly usally i would use your code in a module script,and use a funciton instead as they work better

The code seems to have nothing wrong with it, I think Dutch should just move this to Engine bugs. I’ve never seen something like this.

1 Like

this is my client code.
if anything would come through it would say recieved
and i have a warn above the line saying if it passes the previous code and it just warns it. aswell one after the function.

I am going to try replicating the code in my own hands.

Is there anything earlier in the script that would contain a return and cause that line to not run?

no. the script doesnt include a return. it should be working but it doesnt. its just an easy remoteevent:FireAllClients(arguments)

Is it possible you fire the event before you connect to it on the client?

I’ve just tested this, and the issue was it was nil, for some reason setting up the table the way you did made it nil, here’s how I did it.
Server;

local ReplicatedStorage = game:GetService("ReplicatedStorage")
game.Players.PlayerAdded:Connect(function(player)
local Tab = {
  5, --Score
  50,--Exp
}
ReplicatedStorage.Finish:FireAllClients(false,Tab)
end)

Client;

local ReplicatedStorage = game:GetService("ReplicatedStorage")
ReplicatedStorage.Finish.OnClientEvent:Connect(function(status,tab)
local score = math.floor(tab[1])
local Exp = math.floor(tab[2])
print(game.Players.LocalPlayer.Name,status,score,Exp)
end)

It should work, I left print as a code example. Try it and let me know if it works, hope I was able to help.

its a basic Remoteevent with a .OnClienteEvent()
i send the information to the client if he has won and what his XP score is.
the server goes past the line without erroing or sending it. but it does work whenever i post the FireAllClient line. but not in the script in Server script service

From your code, you aren’t firing the server to start up the script in ServerScriptService. All I see is the server telling the client to do stuff but not the other way around.

i just said that, i send info from the server. that gets recieved by the client. but it never fires. it just goes past the line without erroring or doing anything, The client does recieve something whenever i put that line in the command bar.

You send info from the server but the client never sends anything to the server to tell it to send info back to the client. If you fire the server, then the code inside the Script would run. (Refer to images I edited into my last post)

forgot to delete those lines. That has nothing to do with the issue

I commented out the lines where with the OnServerConnect event and added in placeholder values to make the script work, I’m getting a successful FireAllClient.

Updated Explorer:
image

Script in ServerScriptService:

local CollectAbles = game.Workspace:WaitForChild("Collectables")
local Collected = game.ReplicatedStorage:WaitForChild("Collected")

local GameRunning = false
local Time = 5

--game.ReplicatedStorage.Start.OnServerEvent:Connect(function()
	if not GameRunning then
		GameRunning = true
		
		for _,Collectsble in pairs(CollectAbles:GetChildren()) do
			local ClickDetector = Instance.new("ClickDetector",Collectsble)
			ClickDetector.MaxActivationDistance = 10
			ClickDetector.MouseClick:Connect(function(Player)
				local owner = Instance.new("StringValue")
				owner.Name = "Owner"
				owner.Value = Player.name
				owner.Parent = Collectsble
				ClickDetector:Destroy()
				Collectsble.Parent = Collected
				game.ReplicatedStorage.Dialouge:FireClient(Player,require(Collectsble.Hint))
			end)
		end
		
		workspace.Finish.Touched:Connect(function(Hit)
			if Hit and Hit.Parent and Hit.Parent:FindFirstChild("Humanoid") then
				if GameRunning and Time >= 1 then
					local Finished = true
					for i,v in pairs(workspace.Interactive:GetChildren()) do
						if v.Solved.Value == false then
							Finished = false
						end
					end
					if Finished then
						GameRunning = false
					end
				end
			end
		end)
		warn("BeforeLoop")
		while GameRunning do
			wait(1)
			Time = Time - 1
			game.ReplicatedStorage.Timer.Value = Time
			if Time == 0 then
				break
			end
		end
		warn("Afterloop")
		if Time >= 1 then
			local Tab = {
				Time = 300 - game.ReplicatedStorage.Timer.Value,
				Score = math.floor((game.ReplicatedStorage.Timer.Value/300)* 300),
				Exp = math.floor((game.ReplicatedStorage.Timer.Value/300)* 600),
				Keys = math.floor(1 + (game.ReplicatedStorage.Timer.Value/300)* 3),
			}
			game.ReplicatedStorage.Finish:FireAllClients(true,Tab)
		else
			local Tab = {
				Score = math.floor(5),
				Exp = math.floor(50),
			}
			game.ReplicatedStorage.Finish:FireAllClients(false,Tab)
			
		end
	end
--end)

Result in Output:
image