Why is my remote event not firing?

Hi, I’m Drippy and my remote event will not fire.
I can’t figure out why it does this but hopefully someone else can.
I made sure all the locals, tittles and other small mistakes are not with in the error.
When I check the output, it shows no error.
It’s like it’s not detecting when the button clicks but I have a piece of code for that too.

Info UI Script:

local event = game.ReplicatedStorage:WaitForChild("PromoPanelInfo")
local Holder = script.Parent
local DName = Holder:WaitForChild("Name")
local CRank = Holder:WaitForChild("CurrentRank")
local UID = Holder:WaitForChild("UserId") 
event.OnClientEvent:Connect(function(Name, Rank, ID)
	Holder:TweenPosition(UDim2.new(0.542, 0, -0.002, 0), "In", "Bounce", 0.6, false)
	DName.Text = Name
	CRank.Text = Rank
	UID.Text = ID
	
end)

Player UI Script:

local plrList = script.Parent.List
local sample = script.Sample
local event = game.ReplicatedStorage:WaitForChild("PromoPanelInfo")
local Name
local Rank
local ID
function clearList()
	for _, item in pairs(plrList:GetChildren()) do
		if item:IsA("TextLabel") then
			item:Destroy()
		end
	end
end
function fillList()
	clearList()
	for _, player in pairs(game.Players:GetChildren()) do
		if not plrList:FindFirstChild(player.Name) then
			local new = sample:Clone()
			new.Name = player.Name
			new.Text = player.Name
			new.Parent = plrList
			Name = player.Name
			Rank = player:GetRankInGroup(5676221)
			ID = player.UserId
			new.MouseButton1Click:Connect(clicked)
		end
	end
	plrList.CanvasSize = UDim2.new(0, 0, 0, plrList.UI.AbsoluteContentSize.Y)
end
function clicked()
	event:FireServer(Name, Rank, ID)
	script.Parent:TweenPosition(UDim2.new(-0, 0, -0.002, 0), "In", "Bounce", 0.6, false)
end
fillList()
game.Players.PlayerAdded:Connect(fillList)
game.Players.PlayerRemoving:Connect(fillList)

If you could help that would be greatly appreciated. :slight_smile:

When you fire from Client to Server, it will fire the player as well. So the Info UI Script should be:

local event = game.ReplicatedStorage:WaitForChild("PromoPanelInfo")
local Holder = script.Parent
local DName = Holder:WaitForChild("Name")
local CRank = Holder:WaitForChild("CurrentRank")
local UID = Holder:WaitForChild("UserId") 
event.OnClientEvent:Connect(function(player, Name, Rank, ID)
	Holder:TweenPosition(UDim2.new(0.542, 0, -0.002, 0), "In", "Bounce", 0.6, false)
	DName.Text = Name
	CRank.Text = Rank
	UID.Text = ID
	
end)

the only thing that changed here is event.OnClientEvent:Connect(function(Name, Rank, ID), which became event.OnClientEvent:Connect(function(player, Name, Rank, ID) . The player that fires the remote will be put as first object so that the server knows who fires it. It should always start with player and then the other objects.

1 Like

Yeah, I understand what you mean by that and it’s fixed but it’s still not firing the event.

1 Like

the clicked() function isn’t getting triggered anywhere. Also when the players gets added it does the fillList() function, but when it gets removed, it’s also fillList. Shouldn’t it be clearList()?

It gets triggered up more. For the fill I was trying to make it so it’s like a refresh, instead of making 2 different ones. It’s just me being lazy.

1 Like
function fillList()
	clearList()
	for _, player in pairs(game.Players:GetChildren()) do
		if not plrList:FindFirstChild(player.Name) then
			local new = sample:Clone()
			new.Name = player.Name
			new.Text = player.Name
			new.Parent = plrList
			Name = player.Name
			Rank = player:GetRankInGroup(5676221)
			ID = player.UserId
			new.MouseButton1Click:Connect(clicked)

Right at the bottom.

1 Like

oh alright no problem, but about your problem. the clicked() function isn’t getting triggered anywhere tho. When is the clicked function supposed to get triggered? when a button is clicked or …?

try this:

local plrList = script.Parent.List
local sample = script.Sample
local event = game.ReplicatedStorage:WaitForChild("PromoPanelInfo")
local Name
local Rank
local ID
function clearList()
	for _, item in pairs(plrList:GetChildren()) do
		if item:IsA("TextLabel") then
			item:Destroy()
		end
	end
end
function clicked()
	event:FireServer(Name, Rank, ID)
	script.Parent:TweenPosition(UDim2.new(-0, 0, -0.002, 0), "In", "Bounce", 0.6, false)
end
function fillList()
	clearList()
	for _, player in pairs(game.Players:GetChildren()) do
		if not plrList:FindFirstChild(player.Name) then
			local new = sample:Clone()
			new.Name = player.Name
			new.Text = player.Name
			new.Parent = plrList
			Name = player.Name
			Rank = player:GetRankInGroup(5676221)
			ID = player.UserId
			new.MouseButton1Click:Connect(function()
				clicked()
			end)
		end
	end
	plrList.CanvasSize = UDim2.new(0, 0, 0, plrList.UI.AbsoluteContentSize.Y)
end
fillList()
game.Players.PlayerAdded:Connect(fillList)
game.Players.PlayerRemoving:Connect(fillList)
  1. the clicked() function went above the fillList() function
new.MouseButton1Click:Connect(clicked()

became

new.MouseButton1Click:Connect(function()
	clicked()
end)

Nope I tried many times and still no call.

May i ask for a screenshot of your explorer. where the Player UI Script is situated

promo GUI - Roblox Studio 12_23_2022 6_57_45 PM
It’s the script called main in Player

I don’t know if I mentioned but it’s in a local script, I need it to be so I can use other functions that I can’t without.

and where is this script situated?

Well, that’s where it’s receiving the function, but the call is in the other script. And I’m having the prob while trying to call the function so I’m pretty sure that I think the problem is there.
My answer sounded like a smart answer, but it was not meant to be.

Could you try this and show me the output? It just prints “success” so that i know if the problem is there or not

local plrList = script.Parent.List
local sample = script.Sample
local event = game.ReplicatedStorage:WaitForChild("PromoPanelInfo")
local Name
local Rank
local ID
function clearList()
	for _, item in pairs(plrList:GetChildren()) do
		if item:IsA("TextLabel") then
			item:Destroy()
		end
	end
end
function fillList()
	clearList()
	for _, player in pairs(game.Players:GetChildren()) do
		if not plrList:FindFirstChild(player.Name) then
			print("success")
			local new = sample:Clone()
			new.Name = player.Name
			new.Text = player.Name
			new.Parent = plrList
			Name = player.Name
			Rank = player:GetRankInGroup(5676221)
			ID = player.UserId
			new.MouseButton1Click:Connect(clicked)
		end
	end
	plrList.CanvasSize = UDim2.new(0, 0, 0, plrList.UI.AbsoluteContentSize.Y)
end
function clicked()
	event:FireServer(Name, Rank, ID)
	script.Parent:TweenPosition(UDim2.new(-0, 0, -0.002, 0), "In", "Bounce", 0.6, false)
end
fillList()
game.Players.PlayerAdded:Connect(fillList)
game.Players.PlayerRemoving:Connect(fillList)

if you do event:FireServer() on the client, then you need to do event.OnServerEvent on the server, not event.OnClientEvent

Okay, it printed “success”, so what is the prob?

It won’t let me. It shows an error, and the error says “OnSeverEvent is not a valid member of RemoteEvent “ReplicatedStorage.PromoPanelInfo””

But my Remote event is call PromoPanelInfo

this is because the Info UI Script is in a Local script.
You have 2 options depending on the situation:

  1. You change the Info UI Script to a server script
  2. You use a bindable event instead of a remote event. Bindable event are used to communicate between client and client or server and server. Make sure to use :Fire instead of :FireServer and .Event instead of OnServerEvent
1 Like