Skip to content

Unexpected behavior with "sendToAll" #31

@bravobravo909

Description

@bravobravo909

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions