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

Help with HTTP?

Asked by 8 years ago

This creates a new label depending on how many limited items the player has. The problem is, I can't pass the item's asset id. It just says the id so I can't just go "TextLabel.Text = hatData.name". Is there anyway to bypass that line in the HTML code on the site? I would really appreciate this help.

local HttpService = game:GetService("HttpService")

local Player = game.Players.LocalPlayer

local raw = HttpService:GetAsync("http://robloxplus.com:2052/inventory?id="..tostring(Player.userId))
local d = HttpService:JSONDecode(raw)

local Face = d.data.face
local Gear = d.data.gear
local Hat = d.data.hat

local hatData = Hat.data
for i = 1, countHat do
    local Count = i
    local TextLabel = Instance.new("TextLabel")
    TextLabel.Text = "Hat["..Count.."]"--where the issue is
    TextLabel.BackgroundTransparency = 1
    TextLabel.Position = UDim2.new(0.5, 0, 0, Count*25)
    TextLabel.Size = UDim2.new(0,0,0,200)
    TextLabel.Font = "ArialBold"
    TextLabel.FontSize = "Size18"
    TextLabel.TextColor3 = Color3.new(255/255,255/255,255/255)
    TextLabel.Parent = script.Parent.Frame
end

Answer this question