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

How to make a GUI appear based on leaderstats?

How do I make it so when a player has a specific leaderstat value, a GUI appears on their screen?

1 answer

✓ Accepted answer

You can use .Changed event

so for example it would look like

local leaderstats = --your leaderstats folder
local value = --your value from leaderstats
local gui = --your gui

value.Changed:Connect(function()
    gui.Enabled = true
end)

or else if you want to check if the new number is higher than a certain number

value.Changed:Connect(function(newValue)
    if newValue > 0 then
      gui.Enabled = true
  end
end)

6 comments

0

I'm using string value so there are no numbers involved

0

i didn't mean to mark answered...

0

you can try if newValue = "your text" then

0

Needed to add an extra '=' in there, but other than that, it worked .

0

Appreciate the help.

0

yeah forgot about that lol. No problems

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