--\\ Test Friend GUI Script
--\\ Vars
local i = Instance.new;
local friends = script.Parent;
--\\ Creating Friend Frame
local function CreateFriendFrame(friendname)
local frame = i("Frame", friends);
frame.Name = "FriendName";
frame.Size = UDim2.new(1, 0, 0.05, 0);
frame.Position.Y = frame.Size*(#friends:GetChildren() - 1);
frame.BackgroundTransparency = 1;
local image = i("ImageLabel", frame);
image.Name = "FriendImage";
image.Position = UDim2.new(0.01, 0, 0, 0);
image.Size = UDim2.new(0.2, 0, 1, 0);
--\\image.ImageRectOffset = Vector2.new(25, 0);
--\\image.ImageRectSize = Vector2.new(55, 55);
image.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username="..friendname
local name = i("TextLabel", frame);
name.Name = "FriendName";
name.BackgroundTransparency = 1
name.Position = UDim2.new(0.23, 0, 0, 0);
name.Size = UDim2.new(0.5, 0, 0.5, 0);
name.Font = Enum.Font.SourceSansLight;
name.FontSize = Enum.FontSize.Size32;
name.Text = friendname;
local current = i("TextLabel", frame);
current.Name = "LobbyOrInGame";
current.BackgroundTransparency = 1;
current.Position = UDim2.new(0.23, 0, 0.5, 0);
current.Size = UDim2.new(0.5, 0, 0.5, 0);
current.Font = Enum.Font.SourceSansLight;
current.FontSize = Enum.FontSize.Size32;
current.Text = "IN GAME";
end
local gameId = "60ef96b7-466e-4003-9564-c278be4a643d"
for i,v in pairs(game.Players.LocalPlayer:GetFriendsOnline()) do
if(v.LocationType == 4) then
if v.GameId == gameId then
CreateFriendFrame(game.Players:GetNameFromUserIdAsync(v.VisitorId))
end
end
end
COMMUNITY QUESTION
Any idea what's wrong with this?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
What IS wrong with it? What's it supposed to do? What's it do instead? What debugging have you done?
Any errors?
Basically what it is supposed to do is it's supposed to search if any of the localplayer's friends are online, and if they are, if they're in the same universe, and if they're in the same universe what it does is it creates a new frame, with an image, and a textlabel, and it says the friends name and that they're IN-GAME, and it has a picture of them, but none of it is happening, for debugging we
(continued) have rewritten the code numerous times and adding slight changes to it. We only had one error which was something about Can't index the Y Offset to Something, but we haven't been getting that anymore. and it still doesn't work.