Remote Event Not Firing?

So I’m trying to make a tool delete system and it doesn’t seem to fire the remote event.
Local Script:

for _,v in pairs(Output:GetChildren())do
	if(v:IsA("Frame")) then
		v:WaitForChild("DeleteTool").MouseButton1Click:Connect(function()
			local Args = {
				[1] = 'Delete Tool',
				[2] = Input.Text,
				[3] = v:WaitForChild("Name").Text,
			}
			Event:FireServer(unpack(Args))
			v:Destroy()
		end)
	end
end

Server:

Event.OnServerEvent:Connect(function(Client, Type, Target, ToolName)
	if(Type == "Delete Tool")then
		if(Players:FindFirstChild(Target))then
			local playerToTarget = Players:FindFirstChild(Target)
			if(playerToTarget.Backpack:FindFirstChild(ToolName))then
				playerToTarget.Backpack:FindFirstChild(ToolName):Destroy()
			end
		end
	end
end)

ezgif.com-gif-maker

Taking into count this, did you made a variable for “Players”?

1 Like

Yes, I did make a Players Variable.

Did you add a “print” function at the top of the remote event (server side) to see what exactly is being sent or to see if the server got the request at all?

Yeah I did and it’s not firing at all I have to put the for loop into a while wait() do to make it work for some reason but it I do put it in a while wait() do it will spam fire the event.

You’ll have to implement a couple prints in the LocalScript to figure out why the RemoteEvent isn’t firing, since everything else seems fine.

also imo the Args table seems unnecessary, I would just do:

 Event:FireServer("Delete Tool", Input.Text, v.Name.Text)
2 Likes

This is the outcome when I put the local script in a while wait() do