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
local currencyNeeded = 10 local plr = game.Players:GetPlayerFromCharacter() if plr.leaderstats.Cash.Value >= currencyNeeded then game.StarterGui.PlacementGui.Frame.Ranged.Active = true else game.StarterGui.PlacementGui.Frame.Ranged.Active = false end
You are editing the active value in startergui instead of the player's gui. Instead, use plr.PlayerGui, like this.
local currencyNeeded = 10 local plr = game.Players:GetPlayerFromCharacter() if plr.leaderstats.Cash.Value >= currencyNeeded then plr.PlayerGui.PlacementGui.Frame.Ranged.Active = true else plr.PlayerGui.PlacementGui.Frame.Ranged.Active = false end
Let me know if this helps.