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

How does one make a "Wallet GUI"?

Asked by 10 years ago

I am attempting to make a universe where the hub you can buy games and get some for free, but that's not the problem. The "Wallet GUI" is not operational. My script will be below. It is printing: Error in the GUI.

local Read = LoadLibrary("RbxUtility").DecodeJSON;
local Frame = script.Parent.Frame
local TicketsLabel, RobuxLabel = Frame.Tickets.Amount, Frame.Robux.Amount;
while true do
    local success, currency = ypcall(function() return game:HttpGet("https://api.roblox.com/my/balance", true) end);
    if success then
        local currency = Read(currency);
        TicketsLabel.Text = tostring(currency.tickets);
        RobuxLabel.Text = tostring(currency.robux);
    else
        TicketsLabel.Text = "Error";
        RobuxLabel.Text = "Error";
    end
    wait(5)
end

1 answer

Log in to vote
0
Answered by 10 years ago

Heard of HttpService?

local Frame = script.Parent.Frame
local TicketsLabel = Frame.Tickets.Amount
local RobuxLabel = Frame.Robux.Amount
while true do
    local currency = game:GetService("HttpService"):JSONDecode(game:GetService("HttpService"):GetAsync("https://api.roblox.com/my/balance", true))
    TicketsLabel.Text = tostring(currency[2])
    RobuxLabel.Text = tostring(currency[1])
    wait(5)
end

:) I've removed some potentially glitchy stuff from the script and tidied it up. You don't exactly need ypcall since it's probably not going to error. If it was to, then nobody would be in your game (ROBLOX server crash).

0
When I tried to it said Cannot Parse JSON xkiller777 5 — 10y
0
Try using some string manipulation YaYaBinks3 110 — 10y
Ad

Answer this question