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

Can anyone help me make a buy button script?

Asked by 8 years ago

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!

0
Give us what you have so far so w can help. JamesLWalker 297 — 8y
0
People are probably adding to the leaderstats. All you need to do is replace the leaderstats line with whatever you use to keep track of points. Perci1 4988 — 8y
0
okay, sorry i didnt see these messages. TheDexterousBuilder 0 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

``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)

Ad

Answer this question