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

can i make a gui change if certain stats are applied?

i have an idea of making a game where the player only gets one chance and one way i am thinking of making sure that they only get one chance is by making a menu that removes the play button when they die. one way i am thinking of doing this is using leader board stats so when a player has 1 death then it adds to the leaderboard stat. but is it possible to make it so the gui changes if they have 1 death?

2 answers

Use an if statement at the beginning of the play button, the script will run everytime the user dies (And the UI is being created).

To make it even more secure you should fire a remote event when clicking play that will see if they have 1 death or more on the server side.

I am a bit new to answering questions, but I have also been working with GUI's lately, so I might as well help you out. You can create a script inside your play GUI where it becomes invisible when the player has a death. For example, you can use something along the lines of;

if player.leaderstats.Deaths.Value >= 1 then
script.Parent.(whatever you named your button).Visible = false

I hope this helps.

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