What do you want to achieve? Load group emblem on a players billboardgui when they join.
What is the issue? It’s always white but when I go to a decal and replace the ID it works.
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!)
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?
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. :^)
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
Player.Clan.Value Is a value that’s inside of the player, It’s from a datastore and it loads in automatically 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
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.
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