Hi, I would like comments from others on my code. This is my first post on the DevForum.
What does the code do and what are you not satisfied with?
My code ensures that all of a player’s character meshes will be removed (they are replaced to blocky shapes) every time he/she spawns. I just think my code isn’t perfect.
What potential improvements have you considered?
I haven’t come across a possible improvement yet.
How (specifically) do you want to improve the code?
I want my code to be clear and run in the fastest way possible.
local Players = game:GetService("Players")
function PlayerAdded(Player) --Player joins
local function CharacterAdded(Character) --Character of the player loads
local Humanoid = Character.Humanoid
local HumanoidDescription = Humanoid:GetAppliedDescription() --Current HumanoidDescription used by the Humanoid
HumanoidDescription.Head = 0
HumanoidDescription.LeftArm = 0
HumanoidDescription.LeftLeg = 0
HumanoidDescription.RightArm = 0
HumanoidDescription.RightLeg = 0
HumanoidDescription.Torso = 0
repeat wait() until Character.Parent == game:GetService("Workspace") --Wait until the character is in the Workspace
Humanoid:ApplyDescription(HumanoidDescription) --Apply HumanoidDescription
end
Player.CharacterAdded:Connect(CharacterAdded) --Connect the CharacterAdded function
end
Players.PlayerAdded:Connect(PlayerAdded) --Connect the PlayerAdded function