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.
1.) A regular script can not find the "LocalPlayer" (Line 3) You will have to make this script a local script instead or replace line 3 with:
local player = script.Parent.Parent.Parent.Parent.Parent
2.) in line 8, you do not use "If" correctly, you got the general idea though. You need to replace line 8 with:
if (Selling.Value >= 1500 then)