I recently asked a question asking how to have a script fire the remote event, that is working, but now I need help with the receiving script. This is the working script:
local SandSell = workspace.Events.SandSell
local function Touched(Part)
local Player = game.Players:GetPlayerFromCharacter(Part.Parent)
if Player then
SandSell:FireClient(Player)
print("Sell function has been sent")
end
end
script.Parent.Touched:Connect(Touched)
This is the non-working script:
local leaderstats = game.Players.LocalPlayer:WaitForChild("leaderstats")
local NonShow = game.Players.LocalPlayer:WaitForChild("NonShowing")
local SandSell = workspace.Events.SandSell
SandSell.OnClientEvent:Connect(function(Player)
print("Event Was Received")
if NonShow.BPS.Value > 0 then
print("Backpack Value is Greater than 0")
leaderstats.Cash.Value = leaderstats.Cash.Value + NonShow.BPS.Value
print("Sold")
NonShow.BPS.Value = 0
print("Reset BP Value")
else
end
end)
Can I get any help? I don't understand what I'm doing wrong.

4 comments
Formatting got all ripped up in the code blocks, It's actually make correctly in Studio
Could you be more specific? Which parts exactly are not working? Is it printing things outside of the OnClientEvent? Is it not printing things inside of the event?
Nothing is being printed from the second script, I'm unsure which part isn't correct.
I'll accept an answer when it works for me.