In one of my recent posts (which got unlisted due to it being in the wrong category) I had asked how to change the color of the blue box around tools when you equip them, and I luckily got an answer saying I have to make my own custom UI, so here I am asking, how would I go about scripting a custom tool UI?
If you are saying that, you want to make it so that if someone equips a specific tool it gives them a gui. You can ask roblox built in studio assistant for that.
no I meant like the UI that appears for all tools at the bottom of the screen…
this one
Quick google search found some tutorials for you! Not sure if they are any good but hopefully they can show you how to actually do it:
Tutorials
Free Resources:
Now as someone who has done this before, I can give you the general basis of how to do it.
Step number one would be removing the default hotbar/backpack which can be done with this:
-- This is a local script inside of startergui
game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
After that you would need to design the UI, whenever an item is added to the players backpack (Player.Backpack) you would clone a UI element you have created and put it on your custom hotbar.
When an item is added to the players character that means they have it equipped so you would change the UI item to whatever.
there are a lot of other things you’d have to do, such as when one of these UI items are activated, equip or unequip the item accordingly.
So yeah start by doing that and we’ll go from there.
Alright, I’ll try these resources out and see what works, thanks for the help!
I’m pretty sure Tools already do this, but you can mess around with doing dynamic UI with some coding.
Sorry, but you misunderstand what I said, I meant making a custom Toolbar UI, which replaces the one that’s there, I was just replying to the other guy, so you got the wrong message on accident.
By the way, using this do I like use natural things that would go in a ScreenGUI, such as frames?
You can use an GuiObject you see fit!
That also includes UICorners, UILayouts, UIPadding, and more!
unpopular opinion:
coding a custom backpack is a headache
god all i wanted to do was to just change the backpack UI, and that REQUIRED a custom one
i hate roblox never develop on here
Oh, well in that case I guess I’m pretty good at this ahead of time!
I do have to agree though, they are a pain to script lol.
Glad to hear!
seriously, why do you have to code your own backpack just to change the damn UI?
like man, let me change the gui
Anyway, I’ve designed my UI
guess I’ll go check out the links now.
Here you go! You would just have to change some values and what not but it is a base of a script for this sorta thing. Ik so swag :]
-- // Services //
local StarterGui = game:GetService('StarterGui')
local Players = game:GetService('Players')
-- // UI //
local GUI = script:FindFirstChildOfClass('ScreenGui')
local HotbarFrame = GUI:FindFirstChild('Hotbar',true)
local ItemTag:GuiObject = 'TagHere'
-- || Set Values ||
GUI.ResetOnSpawn = true
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
-- // Player //
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Backpack:Backpack = Player.Backpack or Player:WaitForChild('Backpack')
-- // Functions //
local function FindTag(Tool:Tool)
for _, Tag:Instance in HotbarFrame:GetChildren() do
if Tag:IsA('GuiObject') and Tag:FindFirstChild('Tool') then
return Tag
end
end
return
end
local function CreateTag(Tool)
local Tag = ItemTag:Clone()
local ReferenceValue = Instance.new('ObjectValue'); ReferenceValue.Value = Tool; ReferenceValue.Name = 'Tool'; ReferenceValue.Parent = Tag
-- // Set Values Of Tag //
Tag.Parent = HotbarFrame
end
local function ItemControl(Tool:Tool)
if not Tool:IsA('Tool') then return end
local Tag = FindTag(Tool)
if Character:IsAncestorOf(Tool) then -- || Tag is Equipped ||
if not Tag then
Tag = CreateTag()
end
-- // Display Tag Stuff //
elseif Backpack:IsAncestorOf(Tool) then -- || Tag Is not Equipped ||
if not Tag then
Tag = CreateTag()
end
-- // Display Tag Stuff //
elseif Tag then
Tag:Destroy()
end
end
-- // Main //
Character.ChildAdded:Connect(ItemControl)
Character.ChildRemoved:Connect(ItemControl)
Backpack.ChildAdded:Connect(ItemControl)
Backpack.ChildRemoved:Connect(ItemControl)
I made this in 5 minutes and didnt test it so if it doesnt work well uh I suck so yeah.
Idk why I made this I got bored.
:]
you made this… for me…?
aww thats so cute of you!
look at you spending time to make a gift for my birthday tomorrow that i am not celebrating just like any other one!
i love you too!
thats not what I said
Happy birthday though!