Firing remote event but the only thing that prints is my client?

I am trying to make a gui where you can pay your bills
Here is the localscript in the “Pay bills” button in a TextButton

script.Parent.MouseButton1Click:Connect(function()
	print("sending bill request")
	game.ReplicatedStorage.PayBills:FireServer()
end)

game.ReplicatedStorage.PayBills.OnClientEvent:Connect(function(paid)
	if paid then
		script.Parent.Parent.Visible = false
	else
		script.Parent.Text = "Not enough funds in checking"
		task.wait(3)
		script.Parent.Text = "Pay Bills"

	end
end)

Here is the server script under the remot event “PayBills”

script.Parent.OnServerEvent:Connect(function(plr)
	print("bills connected")
	local bills = game.Workspace.Claiborne.Account.Bills
	local checking = game.Workspace.Claiborne.Account.Checking
	local totalBillsCost = 0
	
	for i,v in pairs(bills:GetChildren()) do
		totalBillsCost += v.Value
	end
	print("counting up dem bills")
	task.wait(1)
	
	if checking.Value >= totalBillsCost then
		print("bills [paid]")
		checking.Value -= totalBillsCost
		script.Parent:FireClient(plr,true)
	else
		print("bills [NOT paid]")
		script.Parent:FireClient(plr,false)
	end
	
end)

All it prints is “sendind bill request”
How is this even possible

if the script is inside of the Remote Event and the Remove Event is in ReplicatedStorage that’s why.

Scripts can’t run inside ReplicatedStorage

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.