GetEmblem Doesn't Work

  1. What do you want to achieve? Load group emblem on a players billboardgui when they join.
  2. What is the issue? It’s always white but when I go to a decal and replace the ID it works.
  3. What solutions have you tried so far? I looked at the roblox page for load group emblem and it still doesn’t work
if Clan then
		if Clan.Value ~= '' then
			if Player.Character then
				local GroupService = game:GetService("GroupService")

				local function getEmblemAsync(groupId)
					local groupInfo = GroupService:GetGroupInfoAsync(groupId)
					return groupInfo.EmblemUrl
				end
				
				local clone = game.ServerStorage.ClanLabel:Clone()
				clone.Parent = Player.Character.Head
				clone.ClanPhoto.Image = getEmblemAsync(tonumber(Player.Clan.Value))
			end
		end
	end```

Because it’s not an rbxasset. You need to actually get the ID, then turn it into an rbxasset.

Something like this:

if Clan then
		if Clan.Value ~= '' then
			if Player.Character then
				local GroupService = game:GetService("GroupService")

				local function getEmblemAsync(groupId)
					local groupInfo = GroupService:GetGroupInfoAsync(groupId)
                    local EmblemUrl = Instance.new('Decal', script).Image = groupInfo.EmblemUrl
					return EmblemUrl.Texture
				end
				
				local clone = game.ServerStorage.ClanLabel:Clone()
				clone.Parent = Player.Character.Head
				clone.ClanPhoto.Image = getEmblemAsync()
                script.Decal:Destroy()
			end
		end
	end

You’re also setting an Image to an unknown value to us, might want to look into that. Anyway, if this did work, let me know!

(Also, it’s unknown to my knowledge how to convert a Roblox asset into an rbxasset without a decal, so this is the best method I believe. Correct me if I’m wrong, though!) :wink:

1 Like

You cant write anything in the code block after return.

1 Like

Whoops, I was looking at that but still decided to do it anyway, thanks!

1 Like


Doesn’t seem to work

Using the following:

local GroupService = game:GetService("GroupService")

local function getEmblemAsync(groupId)
	local groupInfo = GroupService:GetGroupInfoAsync(groupId)
	return groupInfo.EmblemUrl
end

script.Parent.Image = getEmblemAsync(5206588)

I was able to get the groups EmblemUrl to display. Can you quickly confirm that your code is getting to this point with a print statement right under the line that sets the ImageLabel?

1 Like

I tried adjusting it and stuff but there is just some stuff I’m not quite sure about

I just updated it, try again!

This text will be blurred

1 Like

Okay so
image


It gets everything

When is this firing? Is it on a CharacterAdded?

1 Like

Its currently on player joined and then waiting for character

But im going to switch it to a characteradded on a different script later

Gotcha. Hm, just for debugging purposes could you add a task.wait(5) right below the local clone = game.ServerStorage.ClanLabel:Clone(), I wouldn’t recommend this for actual production but I want to rule out anything happening with the specific event before I look into it more. :^)

1 Like

Do you want me to do it with the prints?

Either is fine honestly, no need for the print statements anymore though as we’ve confirmed that the code is passing the if statements

1 Like

Okay, I did it and nothing changed :’) It just took a bit to load the white image

Alright, so your if statements are passing all of the checks and it doesn’t seem to be an issue with where the parenting is happening, could you give more information on what Player.Clan.Value is? Maybe you could try printing Player.Clan.Value right before the clone.ClanPhoto.Image just to confirm it’s what it is supposed to be

1 Like

Player.Clan.Value Is a value that’s inside of the player, It’s from a datastore and it loads in automatically :slight_smile: It’s the group id for the clan someone joined and the system works ex:

Leaving clan removes the value joining adds the group id as ur value :slight_smile:

I see you have an overhead with stuff that seems to be loading in fine (the players name etc.), is the clan image included in this overhead or is it a different overhead completley?

One final thing you could try is going to your character in workspace and directly looking to see what the imageId is for ClanPhoto. If it’s blank then for whatever reason I would be under the assumption this is probably an issue with either the group emblem you are trying to fetch or possibly something else.

1 Like

It’s a different overhead but the group emblem is an id:
http://www.roblox.com/asset/?id=9261176738
It’s completely white, I put the id on an existing decal and it redirects to it:
https://www.roblox.com/library/9261176738/glacials-sword-fighting

I’m unsure why this is the case.