#GUI help
1 messages · Page 1 of 1 (latest)
show code
Alr DMs.
why not here
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
so what's the issue exactly
I can open the gui n stuff, but when I click any of the buttons. Nothing works.
** You are now Level 1! **
do you get any errors?
Not that I know of. If I did I wouldn't know where to find em.
Just started developing.
can you show the server script if there is one
-- 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)
what's uniform.Clothes
That'd be the clothes in my uniforms data script.
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.
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
Kinda like this;
Uniform_1 = {
Clothes = {
Shirt = 116254409156218,
Pants = 110427032678596
},
Covers = {
"Vest"
},
Accessories = {
}
},
i see
Its Uniform_1 - Uniform_9
Yeah.
no need
Alr.
quick question
Yeah.
do your characters clothes get removed when you press the button
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
these
Alr.
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
Do I put it before or after the end?
** You are now Level 2! **
on the next line
Alr lemme wait for studio to stop crashing then Ill test it.
alright
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.
that's not a roblox thing and instead a free model you could've inserted
Ah came with the game, bought it from some guy.
yeah that's most likely the reason
Probably.
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
Waiting for studio to load then Ill test that thing.
👍
Yeah will do ,thanks.
I’m not seeing a print at all.
can you put a print before those lines now
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
Alr, thanks.
Need scripts to fix your scripted