Remote event invocation queue exhausted

hello robloxians,
so i am just release new game today and some events no works here is the problem:


the scripts of that:

local player = game.Players.LocalPlayer

game.ReplicatedStorage.Events.UnboxBubble.OnClientEvent:Connect(function(DisplayUI)
	script.Parent.Visible = true
	wait(5)
	script.Parent.Visible = false
end)

game.ReplicatedStorage.Events.BasicCrate.OnClientEvent:Connect(function(BasicCrate)
	script.Parent.Crate.BasicCrate.Transparency = 0
	script.Parent.Crate.UncommonCrate.Transparency = 1
	wait(5)
	script.Parent.Crate.BasicCrate.Transparency = 1
	script.Parent.Crate.UncommonCrate.Transparency = 1
end)

while wait() do
	if script.Parent.BubblePrizeText.Text == "Basic Bubble" and game.Players.LocalPlayer.BubbleInventory.Bubble1.Value <= 1 then
		game.ReplicatedStorage.Events.Bubbles.BasicCrateBubbles.BlueBubble:FireServer()
		print("fire 1")
	elseif game.Players.LocalPlayer.BubbleInventory.Bubble1.Value >= 1 then
		game.ReplicatedStorage.Events.OwnBubble:FireServer()
		print("Already Own This Bubble.")
	end
end	

while wait() do
	if script.Parent.BubblePrizeText.Text == "Fire Bubble" and game.Players.LocalPlayer.BubbleInventory.Bubble2.Value ~= 1 then
		game.ReplicatedStorage.Events.Bubbles.BasicCrateBubbles.FireBubble:FireServer()
		print("fire 2")
	elseif game.Players.LocalPlayer.BubbleInventory.Bubble2.Value >= 1 then
		game.ReplicatedStorage.Events.OwnBubble:FireServer()
		print("Already Own This Bubble.")
	end
end

while wait() do
	if script.Parent.BubblePrizeText.Text == "Gum Bubble" and game.Players.LocalPlayer.BubbleInventory.Bubble3.Value ~= 1 then
		game.ReplicatedStorage.Events.Bubbles.BasicCrateBubbles.FireBubble:FireServer()
		print("fire 3")
	elseif game.Players.LocalPlayer.BubbleInventory.Bubble3.Value >= 1 then
		game.ReplicatedStorage.Events.OwnBubble:FireServer()
		print("Already Own This Bubble.")
	end
end

while wait() do
	if script.Parent.BubblePrizeText.Text == "Toxic Bubble" and game.Players.LocalPlayer.BubbleInventory.Bubble4.Value ~= 1 then
		game.ReplicatedStorage.Events.Bubbles.BasicCrateBubbles.GumBubble:FireServer()
		print("fire 4")
	elseif game.Players.LocalPlayer.BubbleInventory.Bubble4.Value >= 1 then
		game.ReplicatedStorage.Events.OwnBubble:FireServer()
		print("Already Own This Bubble.")
	end
end

while wait() do
	if script.Parent.BubblePrizeText.Text == "Water Bubble" and game.Players.LocalPlayer.BubbleInventory.Bubble5.Value ~= 1 then
		game.ReplicatedStorage.Events.Bubbles.BasicCrateBubbles.WaterBubble:FireServer()
		print("fire 5")
	elseif game.Players.LocalPlayer.BubbleInventory.Bubble5.Value >= 1 then
		game.ReplicatedStorage.Events.OwnBubble:FireServer()
		print("Already Own This Bubble.")
	end
end

script of alret if player own item:

while wait(0.01) do
	
	game.ReplicatedStorage.Events.OwnBubble.OnClientEvent:Connect(function()
		script.Parent.Visible = true
		script.Parent.Text = "You Claimed Your Coins Back Because Get Same Item."
		wait(13)
		script.Parent.Visible = false
	end)
	
	game.ReplicatedStorage.Events.InventoryFull.OnClientEvent:Connect(function()
		if game.Players.LocalPlayer.BubbleInventory.Bubbles.Value >= game.Players.LocalPlayer.BubbleInventory.MaxInventory.Value or game.Players.LocalPlayer.BubbleInventory.Bubbles.Value == game.Players.LocalPlayer.BubbleInventory.MaxInventory.Value then
			script.Parent.Visible = true
			script.Parent.Text = "Your Inventory Is Full."
			wait(6)
			script.Parent.Visible = false
		end
	end)
	
	if game.Players.LocalPlayer.BubbleInventory.Bubbles.Value <= game.Players.LocalPlayer.BubbleInventory.MaxInventory.Value or game.Players.LocalPlayer.BubbleInventory.Bubbles.Value ~= game.Players.LocalPlayer.BubbleInventory.MaxInventory.Value and script.Parent.Visible == true then
		script.Parent.Text = "Error."
		warn(game.Players.LocalPlayer.Name .." With Inventory Error.")
		warn("Getting Player.")
		warn("Trying Open Again..")
		warn("Faild.")
		wait()
		script.Parent.Visible = false
		break
	end
end

thanks for help.

Hey! I think I recognised the issue!

After reading the scripts, I found out that you have used the :FireServer() function which can only be used in a LocalScript, and only the .OnServerEvent() function can catch the fire. Also, the script which catches the fire should be a server-sided script.

What you have done is you have used the FireServer() function, and to catch the fire, you have used .OnClientEvent() function, which runs when the RemoteEvent has been fired from the server side to the player.

Since I did not do a thorough reading of your script, I’m not sure what you are trying to do, but I want to make it clear to you that firing a remoteEvent using the FireServer() function can only be recognised by a server script. However, you can use the :FireClient() or the :FireAllClients() function which can be caught by a localscript

Hoped this helped.
Have a good day! :smiley:

they both local scripts.
image

That’s the issue! RemoteEvents’ task is to communicate between the server and the client. RemoteEvents won’t help you if you are trying to run from one localScript to the other or the other way, i.e. one script to the other. Suggest you to read the API reference to the RemoteEvents.

1 Like

To communicate between LocalScripts you can use BindableFunctions or BindableEvents.

-- First LocalScript
BindableEvent:Fire("Hello World!")
-- Second LocalScript
BindableEvent.Event:Connect(function(argument)
     print(argument)
end)
-- Output: Hello World
2 Likes

The issue is you are spamming the remotes in your while wait() loops (which is a bad practice by the way).

I’m not sure what your exact use case is, but use the Changed or GetPropertyChangedSignal instead of using inifinite loops.

Example:

script.Parent.BubblePrizeText:GetPropertyChangedSignal("Text"):Connect(function()
    game.ReplicatedStorage.Events.Bubbles.BasicCrateBubbles.BlueBubble:FireServer()
end

etc

2 Likes

thanks is work!. :slight_smile: