Help with topbar

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    im trying to make my custom topbar but the image on it doesnt display also im using topbar v2 module
  2. What is the issue? Include screenshots / videos if possible!
    it works great but the image on it doesnt display
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i checked on the api of the topbar module again
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local Icon = require(game:GetService("ReplicatedStorage").Icon)
local player = game.Players.LocalPlayer
local icon = Icon.new()
icon:setImage("rbxassetid://5107166345")
icon:setLeft()
local Themes = require(game:GetService("ReplicatedStorage").Icon.Themes)
icon:setTheme(Themes.Default)
icon.deselected:Connect(function()
	script.Parent:WaitForChild("KillFeedGui").KillFeedFrame.Visible = false
end)
icon.selected:Connect(function()
	script.Parent:WaitForChild("KillFeedGui").KillFeedFrame.Visible = true
end)

here is the current local script for it

1 Like

I believe setImage only requires the ImageId, so

icon:setImage("rbxassetid://5107166345")

Should be

icon:setImage(5107166345)

nope it wont work still
30_____

Are you certain you got the right id then? Maybe you have to convert to an ImageID beforehand?

Could you send a link to this image you are using? Sometimes you will need to get the actual image texture.

image

I’m using a extension to get the image though.

here is the id not made by me and i took it from the toolbox 5107165509

EDIT: The image seems to be fine since it is an actual image can you screenshot your explorer and what it looks like in game

well in my explorer i put a local script inside the startergui folder thats all and in-game is just a black square but the function of the button is working

Can I see the gui layout? It could be something with the Icon module or something. What is the module you are losing?

i use the topbar v2 module and its in replicated storage

image

not only that when i use setRight() function the icon doesnt be in the right side

Here you are trying to require a script.

And setting the image of the script.

yeah i require the module then i use new() function to make a topbar icon and i use setImage() to put an image

This is what the function says in the module so I dont think it matters if you have the rbxassetid infront of it or not

function Icon:setImage(imageId, toggleState)
	local textureId = (tonumber(imageId) and "http://www.roblox.com/asset/?id="..imageId) or imageId or ""
	return self:set("iconImage", textureId, toggleState)
end

that never helped me --
30
___

Removing the setTheme seemed to fix the image for me

local Icon = require(game:GetService("ReplicatedStorage").Icon)
local player = game.Players.LocalPlayer
local icon = Icon.new()
icon:setImage(5107166345)
icon:setLeft()
icon.deselected:Connect(function()
	script.Parent:WaitForChild("KillFeedGui").KillFeedFrame.Visible = false
end)
icon.selected:Connect(function()
	script.Parent:WaitForChild("KillFeedGui").KillFeedFrame.Visible = true
end)

thank you so much it worked!!
annoying 30

1 Like

Anytime! If you have anymore issues don’t be afraid to make another post!

Also I as a bit confused myself as to why you were using setTheme in that case since it’s the default theme haha