#GUI help

1 messages · Page 1 of 1 (latest)

stable sedge
#

I’m trying to make a GUI uniform giver and team changer. (Two different GUIs) neither are working. All of my scripts look good but Idk what’s breaking them. Any suggestions?

dreamy drift
#

show code

stable sedge
dreamy drift
#

why not here

stable sedge
#

ClientController (LocalScript)

-- ClientController

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local player = Players.LocalPlayer
local gui = script.Parent

local UniformData = require(gui:WaitForChild("UniformData"))
local ApplyUniform = ReplicatedStorage:WaitForChild("ApplyUniform")

-- Frames
local content = gui.MainFrame.ContentFrame
local frames = {
Clothes = content.ClothesFrame,
Covers = content.CoversFrame,
Accessories = content.AccessoriesFrame
}

-- Tabs
local tabs = {
Clothes = gui.MainFrame.TabBar.ClothesTab,
Covers = gui.MainFrame.TabBar.CoversTab,
Accessories = gui.MainFrame.TabBar.AccessoriesTab
}

local currentTab = "Clothes"

-- Tab switching
for tabName, button in pairs(tabs) do
button.MouseButton1Click:Connect(function()
currentTab = tabName
for name, frame in pairs(frames) do
frame.Visible = (name == tabName)
end
end)
end

-- Uniform buttons
for category, frame in pairs(frames) do
for _, button in ipairs(frame.UniformGrid:GetChildren()) do
if button:IsA("TextButton") then
button.MouseButton1Click:Connect(function()
local uniformName = button.Name
if UniformData[uniformName] then
ApplyUniform:FireServer(uniformName, currentTab)
end
end)
end
end
end

dreamy drift
#

so what's the issue exactly

stable sedge
gusty stirrupBOT
#

studio** You are now Level 1! **studio

dreamy drift
#

do you get any errors?

stable sedge
#

Not that I know of. If I did I wouldn't know where to find em.

#

Just started developing.

dreamy drift
#

can you show the server script if there is one

stable sedge
#

-- UniformServer

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local UniformData = require(ReplicatedStorage:WaitForChild("UniformData"))
local ApplyUniform = ReplicatedStorage:WaitForChild("ApplyUniform")

local function applyClothes(character, clothes)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then return end

local desc = humanoid:GetAppliedDescription()

desc.Shirt = clothes.Shirt or 0
desc.Pants = clothes.Pants or 0

humanoid:ApplyDescription(desc)

end

local function clearAccessories(character)
for _, item in ipairs(character:GetChildren()) do
if item:IsA("Accessory") then
item:Destroy()
end
end
end

ApplyUniform.OnServerEvent:Connect(function(player, uniformName, category)
local character = player.Character
if not character then return end

local uniform = UniformData[uniformName]
if not uniform then return end

if category == "Clothes" then
    applyClothes(character, uniform.Clothes)

elseif category == "Accessories" then
    clearAccessories(character)
    for _, assetId in ipairs(uniform.Accessories) do
        local accessory = game:GetService("InsertService"):LoadAsset(assetId):GetChildren()[1]
        if accessory then
            character.Humanoid:AddAccessory(accessory)
        end
    end

elseif category == "Covers" then
    -- Placeholder: depends on how your cover models are stored
    -- You should weld or attach models here
end

end)

dreamy drift
#

what's uniform.Clothes

stable sedge
#

That'd be the clothes in my uniforms data script.

dreamy drift
#

i get that part but what asset is it

#

like what type of asset is it

stable sedge
#

I don't think its an asset itself, it's IDs taken off my group. But theres 3 categories under the uniforms code;
Clothes,
Accessories,
Covers.

dreamy drift
#

okay my bad for not forming my sentence well
can you show what uniform.Clothes is
like how it looks inside of the script and what not

stable sedge
#

Kinda like this;

Uniform_1 = {
Clothes = {
Shirt = 116254409156218,
Pants = 110427032678596
},
Covers = {
"Vest"
},
Accessories = {

    }
},
dreamy drift
#

i see

stable sedge
#

Its Uniform_1 - Uniform_9

dreamy drift
#

and when you click the button nothing happens?

#

like nothing at all?

stable sedge
#

Yeah.

dreamy drift
#

i see

#

give me a second to test it in studio

stable sedge
#

Alr.

#

Want the whole script so you can see it fully?

dreamy drift
#

no need

stable sedge
#

Alr.

dreamy drift
#

quick question

stable sedge
#

Yeah.

dreamy drift
#

do your characters clothes get removed when you press the button

stable sedge
#

Nope.

#

Just stays the same.

dreamy drift
#

can you make sure the event even runs by adding a print in the script

#

like after these lines

  local uniform = UniformData[uniformName]
    if not uniform then return end
stable sedge
#

Sure.

#

How would I do that?

dreamy drift
#

in the server script put a print like so

print("debug")
#

after those lines

stable sedge
#

Alr.

dreamy drift
#

if it prints "debug" in output then the issue has something to do with the clothes part and not the event part

#

and if it doesn't then the issue is the event itself

stable sedge
#

Do I put it before or after the end?

gusty stirrupBOT
#

studio** You are now Level 2! **studio

dreamy drift
#

on the next line

stable sedge
#

Alr.

#
    if not uniform then return end
    print ("debug")```
#

Like that?

dreamy drift
#

without the space between print ()

#

but other than that yeah

stable sedge
#

Alr lemme wait for studio to stop crashing then Ill test it.

dreamy drift
#

alright

stable sedge
#

Off topic question, my games got some T at the bottom corner, how do I remove that?

#

Like that stupid thing that brings up coming soon n stuff.

dreamy drift
#

could you elaborate

#

i don't really understand what you mean

stable sedge
#

Ah one sec.

#

This thing.

dreamy drift
#

that's not a roblox thing and instead a free model you could've inserted

stable sedge
#

Ah came with the game, bought it from some guy.

dreamy drift
#

yeah that's most likely the reason

stable sedge
#

Probably.

dreamy drift
#

if you want to know how to remove it you can try looking for scripts in the explorer and disabling suspicious ones

#

if that makes sense

stable sedge
#

Waiting for studio to load then Ill test that thing.

dreamy drift
#

👍

stable sedge
#

I’m not seeing a print at all.

dreamy drift
#

can you put a print before those lines now

stable sedge
#

Sure.

#

Roblox ain’t cooperating rn, I’ll try again in a bit. Thanks for the help.

dreamy drift
#

alright

#

if it doesn't print at all even if you put it before those lines it means that there's something wrong in the local script

stable sedge
#

Alr, thanks.

astral wagon