I want to change the clothes ID of players who enter my game, they can choose the clothes they want, but I’m not getting.
Yes, my game is published !
-- Character Customization -- local players = game:GetService("Players") local player = game.Players.LocalPlayer local function STARTER(plr) local character = plr.Character or plr.CharacterAdded:wait() local Pants = character:WaitForChild("Pants") local Shirt = character:WaitForChild("Shirt") --Shirt Inicialization local ListShirt = {"rbxassetid://1402902415"} Shirt.ShirtTemplate = ListShirt[1] --Pants Inicialization local ListPants = {"rbxassetid://1402900791"} Pants.PantsTemplate = ListPants[1] end players.PlayerAdded:Connect(STARTER)
TS: If i put 'print(“something”) ’ behind local shirt, it’s work, but if is after, it’s don’t work, so i think local shirt is wrong
Server scripts are scripts run on the server. Local scripts are scripts that are run on the clients. The people in your game.
Only local scripts can use LocalPlayer
You will need to bind this to a PlayerAdded event.
game.Players.PlayerAdded:Connect(function(Player) print(Player.Name) end)
This code above will print the name of the player who has just joined the game.
Guys i discover the error, in fact I had to create a new instance.
local PantsServer = Instance.new("Pants") PantsServer.Name = "Pants" PantsServer.Parent = character local ShirtServer = Instance.new("Shirt") ShirtServer.Name = "Shirt" ShirtServer.Parent = character local Shirt = character:WaitForChild("Shirt") local Pants = character:WaitForChild("Pants")