I tried searching for some help on this on the forum but couldn’t find anything. What I’m trying to do is check the players leaderstats whenever they click a gui for example:
I’m trying to do this so I can cross out all the ones that the player can’t buy. Here is the script:
local Player = game.Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local openbutton = PlayerGui.ScreenGui.SHOPBUTTON.TextButton
local Gui = PlayerGui.ScreenGui.ShopGUI
local event = game.ReplicatedStorage.remoteevent
openbutton.MouseButton1Click:Connect(function(p)
if Gui.Visible == false then
Gui.Visible = true
end
if Gui.Visible == true then
---Check their leaderstats
end
end)
If you can help me out, please do. Thanks.