I would need help at a GUI To appear and increase money for a robbable bank

Hello all,

So I did a Gui and when i touch something it will give me a Gui on the screen and then on the Gui it should increase Money up to 5000. People that play Jailbreak know what i mean if you know how to do it please help me.

so I added a screen Gui in the starter gui then i added a frame and then 2 text labels on the first label its the money you collect from robbing and the second text label it says that “You are robbing the bank”
this is the script I added into the CashCollected (The first text label)

local player = game.Players.LocalPlayer

script.Parent.Text = “$”…player.WaitForChild(“CashCollected”).Value

player:WaitForChild(“CashCollected”).Changed:Connect(function()

script.Parent.Text = “$”…player:WaitForChild(“CashCollected”).Value

end)

I am a begginer at scripting but I copyed the whole scripts and things I had to do for the bank from Noobie I tried AlvinBlox’s tutorial too but it didnt work.

try this script instead:

while wait() do
script.Parent.Text = "$"..player:WaitForChild("CashCollected").Value
end
1 Like

Ok I will try Thank you !
I ll tell if it works :smiley:

it didnt work :frowning:
It doesnt even show the Gui anymore :confused:

Looping it constantly wouldn’t be smart. The best way to update the text based on the value would be using a

Instance:GetPropertyChangedSignal(Property):Connect(function().

Looping would just hurt performance

Its getting really confusing with this robbable bank :confused:

and where should i put this sorry I am just a begginer I just did this from youtube from Noobies tutorial.

1 Like

Wherever the script is you are doing the GUI in, you would Create a new event with

LocationOfValue.Value:GetPropertyChangedSignal”Value”):Connect(function()

and update the text accordingly

GetPropertyChangedSignal is an event that fires whenever the specified property changes.

Ok I will try that Thank You !

Do I need to cahnge the “LocationOfValue”?

You need to define where the value is located There because I don’t know where it is located

Ok I will try and see ok I ll tell :smiley: thank you

I still dont know What you mean so I took a screenshot of the explorer.

Hope iit cam help.

Is this what u meant?

You just need to define where you put the number value, for example

local NumebrValue = script.Parent.Parent.NumberValue

1 Like

And how can I find it easier.
Thank you for examples but its making me confused.

can i see the location of the “collectedcash”? I might be able to help more after

Sure I ll take a screenshot now.

So i added a ScreenGui in starter Gui and then I added a frame then a local script then frame then CashColelcted which is a text label and then in the cashCollected I added a local script so that it will increase the value over here…

But it didnt work…Could you help please ?