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

Is there a way to see player balance(tix and R$) in-game?

Asked by
Mokiros 135
8 years ago

For example, in-game GUI which shows how much robux and tix player currently have.

0
So how i can use it in game? Mokiros 135 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

It's possible, you have to send a HTTP GET request to http://api.roblox.com/my/balance, which gives you your current ROBUX and Tix encoded in a JSON string.

Note that you can only do this from the server. If you want the information to be sent to the client you should use RemoteFunctions to exchange the information.

local httpService = game:GetService("HttpService")
local url = "http://api.roblox.com/my/balance"

local information = httpService:GetAsync(url)

--OPTIONAL if you want to decode the JSON string
local decodeJSON = assert(LoadLibrary("RbxUtility")).DecodeJSON


print( information )
Ad

Answer this question