Everything works, script is in a serverscript, connected to a localscript.
Only the leaderstat value won’t change.
game.ReplicatedStorage.narko.sprzedawanie.OnServerEvent:Connect(function(player)
local gracz = game.Players:FindFirstChild(player.Name)
local leaderstats = gracz:FindFirstChild("leaderstats").Dolars
local sigma = player.Backpack:FindFirstChild("ziolo")
if sigma then
sigma:Destroy()
end
if sigma == false then
leaderstats.Value = leaderstats.Value + 300
end
end)