this is the regular script inside a textbutton in a frame in a screengui
no errors
local Part = script.Parent
Part.MouseButton1Click:Connect(function()
local player = script.Parent.Parent.Parent.Parent.Parent
if player then
local leaderstats = player:WaitForChild("leaderstats")
local Currency = leaderstats.Rebirths
local Selling = leaderstats.Coins
if (Selling.Value >= 1500) then
Currency.Value = Currency.Value + Selling.Value + 1
Selling.Value = 0
player.leaderstats.Changes.Value = 0
game.Workspace.clink.Playing = true
wait(2)
game.Workspace.clink.Playing = false
end
end
end)
Idk how to get the sound "clink" to just play for the local player, because it would not play when inside the scripts Parent.

2 comments
haven't i told you before, that when the person rebirths, it should just delete all data?
fixed that by adding player.leaderstats.Changes.Value = 0