Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to change a tool's default BACKGROUND gui?

Asked by 4 years ago

I'm trying to change the default actual gui for a tool to a custom one, but not the TextureID. For example if anyone's ever played royal high, they have a custom gui for every tool. and I was wondering if anyone knows how to do it. Right now Im trying to make whenever a tool is added to a players backpack, it creates a gui but Im not enitirely sure how to make it so when a second or third tool is added, it the gui before it moves over a bit. Here is my script so far.

local plr = game.Players.LocalPlayer local char = plr:WaitForChild("Character") local backpack = plr:WaitForChild("Backpack") local childadded = backpack.ChildAdded local count = 1

childadded:Connect(function() local new = Instance.new("ScreenGui") new.Parent = game.StarterGui local newbutton = Instance.new("ImageButton") newbutton.Parent = new newbutton.BackgroundTransparency = 1 newbutton.Image = "rbxgameasset://Images/LogoMakr_3FpbQA" newbutton.Size = UDim2.new(0,80,0,80) end)

0
please put it in a code block SteamG00B 1633 — 4y
0
oh sorry here I will... xX02Dire_Wolf20Xx 11 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

This is created by completely disabling the backpack via

game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

From there, you'd create a format for your hotbar, and then cloning it and checking events for when a player equips, unequips, or when a child is removed from the player's hotbar accordingly.

0
ok thanks Ill try that xX02Dire_Wolf20Xx 11 — 4y
0
if it works, be sure to mark my answer as an accepted answer TheGalaxyRBLX 222 — 4y
0
yeah i know you just want the stuff. Still, I'm glad there's people like you in the world. Ill make sure to do that if it works xX02Dire_Wolf20Xx 11 — 4y
Ad
Log in to vote
1
Answered by 4 years ago
Edited 4 years ago
local plr = game.Players.LocalPlayer
local char = plr:WaitForChild("Character") 
local backpack = plr:WaitForChild("Backpack")
local childadded = backpack.ChildAdded
local count = 1

childadded:Connect(function() 
local new = Instance.new("ScreenGui")
new.Parent = game.StarterGui
local newbutton = Instance.new("ImageButton")
newbutton.Parent = new
newbutton.BackgroundTransparency = 1
newbutton.Image = "rbxgameasset://Images/LogoMakr_3FpbQA"
newbutton.Size = UDim2.new(0,80,0,80)
end)

Answer this question