Ad
Log in to vote
0

Why wont my cash display update?

Asked by 1 month ago

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)

0
no, I dont want to "See:" that! Answer the flipping question surviarlTheJefkillre 38 — 1mo
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. Ziffixture 6785 — 1mo
0
not even close to being identical idiot surviarlTheJefkillre 38 — 1mo
View all comments (6 more)
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. Ziffixture 6785 — 1mo
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. Ziffixture 6785 — 1mo
0
Furthermore, don't be rude while getting help from others on here. RazzyPlayz 465 — 1mo
0
Yeah Soban06 314 — 1mo
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. surviarlTheJefkillre 38 — 1mo
0
It's alright. Just be careful next time. Soban06 314 — 1mo

1 answer

Log in to vote
0
Answered by 1 month ago
Edited 1 month ago

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 
0
Thats not how click detectors work surviarlTheJefkillre 38 — 1mo
0
oh Quintizzle 2 — 1mo
0
You're missing the closing parenthesis for the function call of 'Connect'. Ziffixture 6785 — 1mo
0
CD.MouseButton1Click:Connect(function(plr) PufferfishDev 22 — 1mo
0
That's a GUIButton RBXScriptSignal. He had it right the first time. Ziffixture 6785 — 1mo
Ad

Answer this question