so what im trying to do is, is that i need to make it so if you dont have enough cash the button is not active. I tried this but it did not work
1 | local currencyNeeded = 10 |
2 | local plr = game.Players:GetPlayerFromCharacter() |
3 |
4 |
5 | if plr.leaderstats.Cash.Value > = currencyNeeded then |
6 | game.StarterGui.PlacementGui.Frame.Ranged.Active = true |
7 | else |
8 | game.StarterGui.PlacementGui.Frame.Ranged.Active = false |
9 | end |
You are editing the active value in startergui instead of the player's gui. Instead, use plr.PlayerGui, like this.
1 | local currencyNeeded = 10 |
2 | local plr = game.Players:GetPlayerFromCharacter() |
3 |
4 |
5 | if plr.leaderstats.Cash.Value > = currencyNeeded then |
6 | plr.PlayerGui.PlacementGui.Frame.Ranged.Active = true |
7 | else |
8 | plr.PlayerGui.PlacementGui.Frame.Ranged.Active = false |
9 | end |
Let me know if this helps.