When you click the part it should disappear and add 1 to your Cash, right now the part disappears but the value of cash stays the same. Right now the script is a script inside the part.
local CD = script.Parent.ClickDetector
local Cash = game.Workspace.Value.Value
game.StarterGui.ScreenGui.TextLabel.Text = Cash
local function onClicked()
script.Parent.Parent = game.ReplicatedStorage
Cash = Cash + 1
game.StarterGui.ScreenGui.TextLabel.Text = Cash
end
CD.MouseClick:Connect(onClicked)

10 comments
See: https://scriptinghelpers.org/questions/120682/really-basicsimple-mousebutton1click-script-doesnt-work
no, I dont want to "See:" that! Answer the flipping question
I have zero obligation to do so. That hyperlink will take you to a problem that is identical to yours, in which I already explained how to resolve......... Figure it out from there.
not even close to being identical idiot
Identical in regards to the misconception of 'StarterGui'. If you weren't capable of recognizing that, then I'd say spouting claims on programming experience isn't something you'd want to throw in my direction.
FYI, you can't make attribute pointers in Lua, you'll just allocate the state of 'Value' at runtime into 'Cash' then proceed to overwrite the variable on line 07; Value's value won't change. P.S. It is recommended you refrain from giving an attribute's name to an Instance, especially if that attribute is affiliated with it. I suggest you give 'Value' another name.
Furthermore, don't be rude while getting help from others on here.
Yeah
You probably wont read this but I apologize for by behavior. I was frustrated that no one was answering my question and I didn't see how her question had the same answer to mine since I thought something else was the problem. I just want to say I made a severe and utter lapse in my judgment.
It's alright. Just be careful next time.