Local Script in the ClickDetector
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:FindFirstChild("MouseClicked")
local ClickDetector = script.Parent
local Debounce = false
ClickDetector.MouseClick:Connect(function()
if not Debounce then
Debounce = true
local PlayerTrash = game.Players.LocalPlayer.leaderstats.Trash
RemoteEvent:FireServer(PlayerTrash)
wait(0.01)
Debounce = false
end
end)
OnEvent Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:FindFirstChild("MouseClicked")
RemoteEvent .OnServerEvent:Connect(function(Player, PlayerTrash)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.userId, 0000000) then
PlayerTrash.Value = PlayerTrash.Value + ((1 * (Player.leaderstats.Rebirths.Value + 1)) * 2) -- change the "2" to the multiplying number
else
PlayerTrash.Value = PlayerTrash.Value + (1 * (Player.leaderstats.Rebirths.Value + 1))
end
end)

3 comments
Probably because you're trying to :FireServer() on your "ClickDetector" object and not the RemoteEvent.
you wouldn't even need remote events for this, you can get the player through MouseClick's first parameter: playerWhoClicked
why not just fire the player variable and use it on your server script to access leaderstats