local group = game:GetService("GroupService")
local id = 0
game.Players.PlayerAdded:Connect(function(plr)
wait(2)
while wait(0.01) do
local stop = false
id += 1
local info = 0
if stop == false then
if group:GetGroupInfoAsync(id) then
local info = group:GetGroupInfoAsync(id)
print(info)
if info["Owner"] then
local owner = info["Owner"]["Name"]
local id = info["Id"]
if owner then
local name = info["Name"]
local result = name.." (ID: "..id..") is owned by "..owner.."!"
print(result)
plr.PlayerGui.ScreenGui.TextLabel.Text = result
end
elseif info["Owner"] == nil then
plr.PlayerGui.ScreenGui.TextLabel.Text = "Group found! ID: "..id
while true do
wait()
stop = true
end
end
else
id += 1
end
end
end
end)
It works but it stops because http://roblox.com/groups/12 isn't a valid group. I want it to pass that and add to the id. How do I do it? Error: GroupService:GetGroupInfoAsync() failed because HTTP 404 (Not Found)
You can use LUA's very handy pcall
function to catch errors.
Here is a guide on the Roblox DevForum on how to use them :)