Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behavior with "sendToAll" #31

Open
bravobravo909 opened this issue Feb 5, 2025 · 0 comments
Open

Unexpected behavior with "sendToAll" #31

bravobravo909 opened this issue Feb 5, 2025 · 0 comments

Comments

@bravobravo909
Copy link

Seems like if you fire an event with sendToAll after firing another event with sendTo or sendToAllExcept or sendToList. The "sendToAll" is fired way before.

Line 58

function exported.sendToList(data, players: { Player })
	for _, player in players do
		serverSendFunction(player, id, writer, data)
	end
end

function exported.sendTo(data, player: Player)
	serverSendFunction(player, id, writer, data)
end

function exported.sendToAllExcept(data, except: Player)
	for _, player: Player in Players:GetPlayers() do
		if player ~= except then
			serverSendFunction(player, id, writer, data)
		end
	end
end

function exported.sendToAll(data)
	serverSendAllFunction(id, writer, data)
end

rest of them are using "serverSendFunction" but sendToAll uses a seperate function. I did not completely check the code of what each thing is doing but this should give the rough idea where the error might be occuring. For now i replaced it with

for _, player: Player in Players:GetPlayers() do
	serverSendFunction(player, id, writer, data)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant