Remote Event not firing

Hello. I am currently making a shop for a game that is currently in development, but for some reason the remote event is not firing that removes the players money on the leaderstats is not working.

Local script:

script.Parent.MouseButton1Click:Connect(function()
	local plr = game.Players.LocalPlayer
	local ls = plr:WaitForChild("leaderstats")
	if ls.Money.Value >= 25 then
		local clone = game.ReplicatedStorage.ShopItems:FindFirstChild("Sturdy Scythe"):Clone()
		clone.Parent = plr.Backpack
		game.ReplicatedStorage.ShopEvents.Sturdy:FireServer()

	end
	
end)

Server Script:

script.Parent.OnServerEvent:Connect(function(plr)
	plr.leaderstats.Money.Value = plr.leaderstats.Money.Value + 1
end)

I have placed prints in certain parts of the script, it just stops at the server script.

There is no errors in the output, the answer could be obvious and i’m not seeing it. If you notice anything is wrong, please let me know!

Where are you currently storing your scripts?

Hey, thanks for replying!
Here are the photos;
RobloxStudioBeta_mgW444gL3C RobloxStudioBeta_R2S0uJQiJM

No problem.

Try putting ServerScript in SeverScriptStorage and reference the remote with: game.ReplicatedStorage.ShopEvents.Sturdy.OnServerEvent

Thank you!

The script now works as intended, I appreciate you help.

1 Like

No problem, happy to help!
Good luck making your game! :slight_smile:

1 Like