Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why wont my cash display update?

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

0

no, I dont want to "See:" that! Answer the flipping question

0

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.

0

not even close to being identical idiot

0

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.

0

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.

0

Furthermore, don't be rude while getting help from others on here.

0

Yeah

0

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.

0

It's alright. Just be careful next time.

1 answer

put this script i think it'll work

CD.MouseClick:Connect(function(player)
	script.Parent.Parent = game.ReplicatedStorage
	Cash = Cash + 1
	player.PlayerGui.ScreenGui.TextLabel.Text = Cash
end 

5 comments

0

Thats not how click detectors work

0

oh

0

You're missing the closing parenthesis for the function call of 'Connect'.

0

CD.MouseButton1Click:Connect(function(plr)

0

That's a GUIButton RBXScriptSignal. He had it right the first time.

This discussion is preserved as it was. New answers, comments, and votes are closed.