My script prints the trail but not 1, I don't know why because everything should be working fine?
game.ReplicatedStorage.TrailBuy.OnServerEvent:Connect(function(player, trail)
print(trail)
if player.leaderstatsA.Credit.Value >= 1000 then
print("1")
player.leaderstatsA.Credit.Value = player.leaderstatsA.Credit.Value - 1000
local newtrail = Instance.new("BoolValue", player.Trails)
newtrail.Name = trail
end
end)
Thanks!

2 comments
Try player:WaitForChild("leaderstatsA") - another thing, try keeping it as just "leaderstats" because otherwise roblox doesn't recognise it as a leaderboard and it won't work properly.
It is an invisible leaderstat