I’m trying to create Nitro Booster Perks. The code below works perfectly in the studio but for some reason it errors Can't Parse JSON
when I test it in-game. If you read the code below, you can see which line errors for me.
game.Players.PlayerAdded:Connect(function(player)
local http = game:GetService("HttpService")
local api = "https://discord.com/api/guilds/514884314144702504/members/search?query="
local data = http:RequestAsync({
Url = api..player.Name,
Headers = {
["Authorization"] = "Bot (token)"
}
})
local boostData = http:JSONDecode(data.Body)[1]["premium_since"] -- THIS LINE CAUSES ERRORS
if boostData ~= nil then
isbooster(player)
end
end)
Any help works, thanks.