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

How to make a GUI appear based on leaderstats?

Asked by 2 years ago

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

1 answer

Log in to vote
0
Answered by 2 years ago

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)
0
I'm using string value so there are no numbers involved Mystical_Un1verse 9 — 2y
0
i didn't mean to mark answered... Mystical_Un1verse 9 — 2y
0
you can try if newValue = "your text" then NoReal229 21 — 2y
0
Needed to add an extra '=' in there, but other than that, it worked . Mystical_Un1verse 9 — 2y
View all comments (2 more)
0
Appreciate the help. Mystical_Un1verse 9 — 2y
0
yeah forgot about that lol. No problems NoReal229 21 — 2y
Ad

Answer this question