This buy button script needs to be a script that used the buyers or players robux (if they have) to purchase more points in the game. The only problem that I have is, that everyone who was answering my question in a forum used "leaderstats" and my games leaders stat is like the game Mad Games where it doesn't show on the player list. Can anyone please help me make the script. I have actually started and used YouTube and wiki.roblox to find my answer but nobody can seem to figure out a script to help me without using leaderstats. I have made a script if anyone wants to take a look at how I used or started my script, please ask. Thank you!
``Player = game.Players.LocalPlayer BuyButton = game.StarterGui.PlayerGUI.Player.BuyButton
BuyButton.MouseButton1Down:connect(function(Press) game.StarterGui.PlayerGUI.BuyShopFrame.BackgroundTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.Buy1.BackgroundTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.Buy1.TextTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.Buy2.BackgroundTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.Buy2.TextTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.Buy3.BackgroundTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.Buy3.TextTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.Buy4.BackgroundTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.Buy4.TextTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.Buy5.BackgroundTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.Buy5.TextTransparency = 0 game.StarterGui.PlayerGUI.BuyShopFrame.ShopLabel.TextTransparency = 0 end) if BuyButton.MouseButtown1Down:connect and game.StarterGui.PlayerGUI.BuyShopFrame.BackgroundTransparency = 0 then game.StarterGui.PlayerGUI.BuyShopFrame.BackgroundTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.Buy1.BackgroundTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.Buy1.TextTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.Buy2.BackgroundTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.Buy2.TextTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.Buy3.BackgroundTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.Buy3.TextTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.Buy4.BackgroundTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.Buy4.TextTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.Buy5.BackgroundTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.Buy5.TextTransparency = 1 game.StarterGui.PlayerGUI.BuyShopFrame.ShopLabel.TextTransparency = 1
if game.StarterGui.PlayerGUI.BuyShopFrame.Buy1.MouseButton1Down then function Press()
local passId = 401498222 -- change this to your game pass ID. function isAuthenticated(player) -- checks to see if the player owns your pass return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId) end game.Players.PlayerAdded:connect(function(plr) if isAuthenticated(plr) then print(plr.Name .. " has bought the game pass with id " .. passId) end end) end
end
Player.MouseButton1Down:connect(Press)