Is there some temporary thing I can do, like make fake invisible health bar?
You would have to make one manually
Hiya! Is there a way to make a button Pc/Mobile only? Im making a system where i have a button that will allow mobile users to open the command bar for basic admin essentials but i dont know how to make it mobile only.
Try using:
local UIS = game:GetService("UserInputService")
if UIS.TouchEnabled then
--code for mobile
else
--code for pc
end
There are laptops with touchscreen though, so I wouldn’t only do that.
@gompiegoofy
Try using this instead:
local TopbarPlus = require(game:GetService("ReplicatedStorage").TopbarPlus)
local UserInputService = game:GetService("UserInputService")
local icon = TopbarPlus.new()
if not UserInputService.TouchEnabled then
icon:setEnabled(false)
end
UserInputService.LastInputTypeChanged:Connect(function(lastInputType)
icon:setEnabled(lastInputType == Enum.UserInputType.Touch)
end)
Corrected these mistakes
Old Script
local TopbarPlus = require(game:GetService("ReplicatedStorage").TopbarPlus)
local UserInputService = game:GetService("UserInputService")
local icon = TopbarPlus.new()
if not UserInputService.TouchEnded then
icon:setEnabled(false)
end
UserInputService.LastInputTypeChanged:Connect(function(lastInputType)
icon:setEnabled(lastInputType == Enum.UserInputType.Touch and true or false)
end)
if not UserInputService.TouchEnded then
icon:setEnabled(false)
end
It will always return true, as it is always available if you don’t have a touch device since it is an event. This is to prevent errors from occurring if you connect that event regardless of whether you have a touch device or not.
A better way to handle the start of that is to use
if UserInputService:GetLastInputType() ~= Enum.UserInputType.Touch then
icon:setEnabled(false)
end
On top of that, icon:setEnabled(lastInputType == Enum.UserInputType.Touch and true or false)
is a weird way of formatting that. Why not just have icon:setEnabled(lastInputType == Enum.UserInputType.Touch)
? It is way better for readability.
I’m trying to make a small settings menu and it keeps on throwing this error when i try to use setMenu() or setDropdown()
Icon.new()
:setLabel("Settings")
:setDropdown({
Icon.new()
:setLabel("Overhead Names")
.toggled:Connect(function()
--code here
end) ,
Icon.new()
:setLabel("Toggle Music")
.toggled:Connect(function()
--code here
end) ,
})
scripts based off of how the readme is formatted + the documentation
update: fixed using bind events
trying out the menu bit of topbar+
is there a way to get an icon within an icon?
I meant TouchEnabled
. Used tab to autofill without noticing it was something else.
Don’t know what I was thinking there
Works perfectly after fixing those accidental mistakes!
does anyone know how to / wether its possible to change the buttons TextSize inside a dropdown menu
One problem though.
I used the newest version of topbarplus which is at v3.0.0, but it’s still like this. Does anyone know how to fix this?
Quick update: fixes & improvements are underway; they’re going to take a few weeks longer until the release is ready. Will respond to all comments here and issues/PRs at the repository over this period too!
Is there any way to call icon:select() without fire icon.selected:Connect()?
question about this do i have to make it on client or server?
Anyone ever got an issue where the topbar icons just stop working? They’re still there, they just don’t get updated and cannot be clicked on even though the mouse cursor changes when you hover on them.
No errors, nothing prints or happens when you click on them, pretty weird, was also wondering if it’s possible to make them reset on death
This is intended for the client
Hello, I am new to this entire thing, I got the V 3.0.2 system. I can seem to remove this Controller icon next to the UI button. Is their anyway to disable this? It shows the same for laptop or mobile devices
The button is a backpack symbol and I do not know how to get rid of that controller UI next to it. If this is already answered, can anyone tell me how to resolve this issue ?
It doesn’t appear outside of Roblox Studio unless you use a controller.
The gamepad emulator is likely causing this.
See more info here:
i’m also wondering how to change the dropdown menu buttons textsize. doing the “:modifyTheme({“IconLabel”, “TextSize”, 22})”
isn’t changing it.
I’ve tried a few things here and I’m certain this is something caused by how my game is handling controller support but I honestly cannot find what’s causing this to occur.
I’m seeing this pop up, I’ve read through your docs and saw there’s an API for changing the keybind for this however it did not work for me.
And in the clip below you’ll see that the button displayed is D-pad up not buttonselect and that it shows when using keyboard and mouse but when I switch to controller it goes away?
https://gyazo.com/89ea18f06f94f40f115af6ff045b841d
If you would like this in an mp4 format instead please let me know.