I want to be able to have one Remote Event that controls my Outfits from Client to Server.
The outfits aren’t showing up when the left or right button is pressed and, they shoud be showing up.
I tried making the outfits value into one instead of just shirt and pants as a value but that didn’t change anything.
Left and Right refer to the left and right arrow for character customization.
-- Server Script
game.ReplicatedStorage.EventStorage.BodyDetailUpdated.OnServerEvent:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
if char:WaitForChild("Humanoid") then
if char.Shirt.OutfitValue.Value == 1 then
char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=" --ID goes here
char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=" --ID goes here
elseif char.Shirt.OutfitValue.Value == 2 then
char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=" --ID goes here
char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=" --ID goes here
elseif char.Shirt.OutfitValue.Value == 3 then
char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=" --ID goes here
char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=" --ID goes here
end
end
end)
-- LocalScript
local allShirts = game.ReplicatedStorage:WaitForChild("Outfits"):WaitForChild("Shirts"):GetChildren()
outfit.Value = 1
shirtValue.Value = 1
local allPants = game.ReplicatedStorage:WaitForChild("Outfits"):WaitForChild("Pants"):GetChildren()
outfit.Value = 1
pantsValue.Value = 1
script.Parent.Outfit.Right.MouseButton1Click:Connect(function()
outfit.Value = outfit.Value + 1
if outfit.Value > #allPants and outfit.Value > #allShirts then
game.ReplicatedStorage.EventStorage.BodyDetailUpdated:FireServer()
outfit.Value = 1
shirtValue.Value = 1
pantsValue.Value = 1
end
for clothes = 1, outfit.Value do
if clothes == 1 then
shirtValue.Value = 1
pantsValue.Value = 1
game.ReplicatedStorage.EventStorage.BodyDetailUpdated:FireServer()
elseif clothes == 2 then
shirtValue.Value = 2
pantsValue.Value = 2
game.ReplicatedStorage.EventStorage.BodyDetailUpdated:FireServer()
else
shirtValue.Value = #allShirts
pantsValue.Value = #allPants
game.ReplicatedStorage.EventStorage.BodyDetailUpdated:FireServer()
end
end
end)