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

Help! Why does this script not show data?

Asked by
iNicklas 215 Moderation Voter
8 years ago

I'm asking for its data.

EDIT: not crashing anymore, but wont show the data?

---/ Nickelele
--/ This script uses the ROBLOX+ Api

if pcall(function() game:service'HttpService':GetAsync("http://google.com/") end) then
    game.Players.PlayerAdded:connect(function(player)
        player.CharacterAdded:connect(function(character)
            local Desc = game.HttpService:JSONDecode(game.HttpService:GetAsync("http://robloxplus.com:2052/user?id="..player.userId))
            if Desc.success then
                local D = script.Desc:Clone()
                D.Textl.Text = "Desc: "..Desc.data.bc
                D.Enabled = true
                D.Parent = game.Workspace.Model.Blurb
                D.Adornee = D.Parent
            end
        end)
    end)    
else
print([[Enable your freaking httpservice - nick]])
end
0
Is this your website? MessorAdmin 598 — 8y
0
No, its WebGl3d's domain. It can find RAP,inventory,user etc iNicklas 215 — 8y
0
Ah, k lemma fix the problem then. :) MessorAdmin 598 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

This should fix it..

When your requesting your data from the website its running on JSON so.. it will be a table, like this http://robloxplus.com:2052/user?id=1

Heres your fixed code.. ;D

local Http = game:GetService("HttpService")
local Data = Http:GetAsync("https://www.google.com/")
if Data then
     game.Players.PlayerAdded:connect(function(player)
            player.CharacterAdded:connect(function(character)
            local Presistance = Http:JSONDecode(Http:GetAsync("http://robloxplus.com:2052/user?id="..player.userId,true)) -- Saves your data to a JSON table (if it is a table else its a string :P)
            for i,v in next,Presistance do
                print(i, v)
                if i:lower():find("success") then
                    print'found json table'
                    if i:lower():find("data") then
                       PlrBc = tostring(v)
                    end
                    local ND = script.Desc:Clone()
                    ND.Textl.Text = "Desc : "..PlrBc
                    ND.Enabled = true
                    ND.Parent = workspace.Model.Blurb
                    ND.Adornee = D.Parent
                end
            end
        end)
    end)
end
Ad

Answer this question