Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a gui dissapear if money is not high enough to click on it?

Asked by
M3N0Hax -7
4 years ago

So basically I am making this game called "Pet Rock Simulator". To buy a pet you need to click on a button, but I don't want that button to show until the player has enough money to buy it.

0
Make sure that your checking the money on a normal script, Lava_Scripter 109 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

In order to do something of this nature, I assume you have some type of stat value that represents your money, you would need to connect a function to a money.Changed event. Within the function, you can expect something within the nature of If money.Value == 'however much you want it to be' then gui.Visible = true/false

I will edit this answer so i can go more in depth for you:

You have some type of leaderboard script that determines your money right?, if so, from a local script you can define a few varibles, such as : local player = game.Players.LocalPlayer; local stats = player:WaitForChild("whatever you named your leaderstats")

and ofc define your gui element you want to make invisible, which is most likely the parent of your script right now. next you can create a local function that will keep track of your money:

local function moneyChange() if money.Value >= entervalhere then guielement.Visible = true/false

and then you can hook it up to:

money.Changed:Connect(moneyChange)

Of course what i gave you is pseudo code and it wont just function if you copy and paste this ive just merely layed out what you have to do. I hope this helps you and if you still run into problems contact me on my roblox profile and i can help you more with this and other problems you may have.

0
ok thank you M3N0Hax -7 — 4y
0
if you have any trouble setting it up please dont hesitate to let me know and ill help you out more in depth Si_SenorTN 25 — 4y
0
I am currently having a bit of trouble setting the invisible gui, could you please go more in depth with it as I am a beginner and I don't know much, thanks. M3N0Hax -7 — 4y
0
check my edited answer Si_SenorTN 25 — 4y
Ad

Answer this question