Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How does one make a "Wallet GUI"?

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

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

2 comments

0

When I tried to it said Cannot Parse JSON

0

Try using some string manipulation

This discussion is preserved as it was. New answers, comments, and votes are closed.