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

How Come IT Wont Give Player Points?

Asked by 10 years ago

In my Game/Place I have everything The script, Gui everything, but if someone buys it, it wont give them Player Points, but takes their Robux. Can Someone Help?

1
Show the script.. HexC3D 830 — 10y
0
How are we able to fix it when we have nothing to work with? HexC3D 830 — 10y
0
ok i wil HexC3D NonoTheKing27 0 — 10y
0
+HexC3D NonoTheKing27 0 — 10y
0
THIS IS A FREE MODEL FROM AZARATH AND STOPTHECAKEHATE HexC3D 830 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
local plr = script.Parent.Parent.Parent 
local link = game:GetService("MarketplaceService")
local y = 75 --Offset is fine. Leave it alone.
local statn = "KOs" 

local function create(instanc)
    return function(object)
        local button = Instance.new(instanc)
        for i,v in pairs(object) do 
            button[i] = v
        end
        return button
    end
end



repeat wait() until plr:findFirstChild("leaderstats")
local stat = plr.leaderstats[statn]



local conversions = 
{
    {id = 20024310, points = 1, cost = 4, nam = "Buy 1 Point"}; --Change 123456 to your dev product ID
    {id = 20024777, points = 100, cost = 100, nam = "Buy 100 Point"}; --Do the same
    {id = 20024310, points = 1, cost = 4, nam = "Buy 1 Point"};--Do the same

}


local main = create("Frame")
{
    Size = UDim2.new(0, 250, 0, 0);
    BackgroundTransparency = 1;
    ZIndex = 3;
    Position = UDim2.new(0,-250,.5,-165);
    Name = "Shop";
    Parent = script.Parent
}

local folder = create("Frame")
{
    Size = UDim2.new(0,200,0,300);
    BackgroundColor = BrickColor.new("Really black");
    BackgroundTransparency = .3;
    Active = true;
    ZIndex = 2;
    Parent = main

}

local header = create("Frame")
{
    Size = UDim2.new(.5,0,0,20);
    Position = UDim2.new(1,0,0,0);
    Name = "ShopHeader";
    BackgroundTransparency = 1;
    ZIndex = 3;
    Parent = main
}

local Tbutton = create("TextButton")
{
    Size = UDim2.new(0,20,0,20);
    Position = UDim2.new(1,3,0,0);
    BackgroundTransparency = .25;
    BackgroundColor = BrickColor.new("Really black");
    ZIndex = 3;
    BorderSizePixel = 0;
    Text = ">>";
    TextColor = BrickColor.White();
    Parent = header

}

local label = create("TextLabel")
{
    Text = "PointsShop";
    Size = UDim2.new(1,0,0,20);
    BackgroundTransparency = .25;
    BackgroundColor = BrickColor.new("Really black");
    ZIndex = 3;
    BorderSizePixel = 0;
    TextColor = BrickColor.White();
    Font = "Legacy";
    FontSize = "Size12";
    Parent = header

}

local watermark = create("TextLabel")
{
    Size = UDim2.new(0,0,0,0);
    Position = UDim2.new(1,0,1,0);
    TextXAlignment = "Right";
    TextYAlignment = "Bottom";
    BackgroundTransparency = 1;
    ZIndex = 3;
    TextColor = BrickColor.new("Institutional white");
    Font = "Legacy";
    FontSize = "Size10";
    Text = "GUI by Azarth and stopthecakehate";
    TextTransparency = .9;
    Parent = folder

}

local function buyItem(button)
    button.MouseButton1Click:connect(function()
        local marketId = button["market"].Value
        local pointsToAward = button["points"].Value
        link:PromptProductPurchase(plr,marketId) 
        link.ProcessReceipt = function(receiptInfo)
            if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then
                stat.Value = stat.Value + pointsToAward
            end
        end
    end)
end

for i,v in ipairs(conversions) do 
    local button = create("TextButton")

    {
        Size = UDim2.new(1,0,0,y);
        BackgroundColor = BrickColor.Black();
        TextColor = BrickColor.White();
        TextXAlignment = "Left";
        FontSize = "Size14";
        Position = UDim2.new(0,0,0,((i*y)+2)-(y+2));
        BorderSizePixel = 0;
        Font = "Legacy";
        Text = v.nam;
        ZIndex = 3;
        Parent = folder

    }

    local cost = create("TextLabel")

    {
        Size = UDim2.new(0,0,1,0);
        BackgroundColor = BrickColor.Black();
        TextXAlignment = "Right";
        FontSize = "Size14";
        Position = UDim2.new(1,0,0,0);
        BorderSizePixel = 0;
        TextColor3 = Color3.new(20/255, 166/255, 0/255);
        Text = v.cost.."R$";
        ZIndex = 3;
        Parent = button

    }

    local buyTag = create("IntValue")

    {
        Name = "market";
        Value = v.id;
        Parent = button;

    }

    local pointsTag = create("IntValue")

    {
        Name = "points";
        Value = v.points;
        Parent = button;

    }

    buyItem(button)

end


local gui = main
Tbutton.MouseButton1Click:connect(function()
    if Tbutton.Text == ">>" then
        gui:TweenPosition(UDim2.new(0,0,.5,-165), "Out", "Back", true,.5)
        header:TweenPosition(header.Position - UDim2.new(0,45,0,0), "In", "Quad", true)
        Tbutton.Text = "<<"
    else
        gui:TweenPosition(UDim2.new(0,-250,.5,-165), "Out", "Quad", true,.5)
        header:TweenPosition(UDim2.new(1,0,0,0), "In", "Quad", true)
        Tbutton.Text = ">>"
    end
end)


0
My, My what do we have here 190 lines of script o.e , I have a feeling I'm going to work on this question longer then expected. HexC3D 830 — 10y
0
Output please? That will make it WAY easier. HexC3D 830 — 10y
0
Could you get On Roblox and invite me to a party it will be eaiser NonoTheKing27 0 — 10y
0
THIS IS A FREE MODEL FROM AZARATH AND STOPTHECAKEHATE!!! HexC3D 830 — 10y
View all comments (3 more)
0
I know,but it still works how come it wont give them anything?? NonoTheKing27 0 — 10y
0
At Least I give them Credit for it! NonoTheKing27 0 — 10y
0
Where did you give them credit? fireboltofdeath 635 — 9y
Ad

Answer this question