OK so I made this Character customization GUI and when I scroll through shirts in the studio it works. But in game it doesn't work. The output shows no errors at all. Here's how it works. Basically when a player enters a game they are give a blank shirt, pants and hat. As the player scrolls through the table of shirt id's. The ID is given to the shirt, pants or hat.
-Local Script in GUI-
repeat wait() until game.Players.LocalPlayer.Character
local Player = game.Players.LocalPlayer
local CharacterCustomizationGUI = game.StarterGui:WaitForChild("CustomizationUI")
local ShirtForward = script.Parent.CustomizationTabs.ShirtTab["Shirt Forward"]
local ShirtBackward = script.Parent.CustomizationTabs.ShirtTab["Shirt Backward"]
local Shirt = Player.Character:WaitForChild("Shirt")
local Shirts = {612283113, 541820204, 294747602}
local count = 1
function Update()
Shirt.ShirtTemplate = "rbxassetid://"..Shirts[count]
end
ShirtForward.MouseButton1Down:Connect(function()
if count >= #Shirts then
else
count = count + 1
Update()
end
end)
ShirtBackward.MouseButton1Down:Connect(function()
if count > 1 then
count = count - 1
Update()
end
end)
-Shirt,Pants,Hat Giver-
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local Shirt = Instance.new("Shirt", character)
Shirt.Name = "Shirt"
local Pants = Instance.new("Pants", character)
Pants.Name = "Pants"
local Hat = Instance.new("Accessory", character)
Hat.Name = "Hat"
end)
end)

1 comment
Has my answer been able to help you?