The rigtype to be assigned r15 if the player name lower is jerold09362.
it errors whenever it tries to assign it.
--// SERVICES
local Players = game:GetService("Players")
--// FUNCTIONS
local function PlayerAdded(Player : Player)
Player.CharacterAdded:Connect(function(Char)
Player.CharacterAppearanceLoaded:Connect(function(Char)
if Player.Name:lower() == 'jerold09362' then
local Hum = Char:FindFirstChildOfClass("Humanoid")
Hum.RigType = Enum.RigType.R15
else
local Hum = Char:WaitForChild("Humanoid")
local Description
repeat
wait()
Description = Hum:GetAppliedDescription()
until Description
Description.Head = 0
Description.Torso = 0
Description.LeftArm = 0
Description.RightArm = 0
Description.LeftLeg = 0
Description.RightLeg = 0
Hum:ApplyDescription(Description)
end
end)
end)
end
--// EVENTS/CALLS
Players.PlayerAdded:Connect(PlayerAdded)
It errors: Unable to assign property RigType. EnumItem of type RigType expected, got an EnumItem of type RigType, even though it gets an EnumItem.
maybe try this:
--// SERVICES
local Players = game:GetService("Players")
--// FUNCTIONS
local function SetCharacterToR15(Player)
-- Ensure the player's character spawns with R15 rig
local humanoidDescription = Instance.new("HumanoidDescription")
humanoidDescription.RigType = Enum.HumanoidRigType.R15
Player:LoadCharacterWithHumanoidDescription(humanoidDescription)
end
local function PlayerAdded(Player)
-- Set the player's character to R15 when they join
Player.CharacterAutoLoads = false -- Disable auto-spawn to control the rig
SetCharacterToR15(Player)
-- Handle character customization after spawn
Player.CharacterAdded:Connect(function(Char)
local Hum = Char:WaitForChild("Humanoid")
if Player.Name:lower() == "jerold09362" then
print("Jerold spawned with R15.")
else
local Description = Hum:GetAppliedDescription()
if Description then
-- Customize character appearance (e.g., removing body parts)
Description.Head = 0
Description.Torso = 0
Description.LeftArm = 0
Description.RightArm = 0
Description.LeftLeg = 0
Description.RightLeg = 0
Hum:ApplyDescription(Description)
else
warn("Failed to get description for", Player.Name)
end
end
end)
end
--// EVENTS/CALLS
Players.PlayerAdded:Connect(PlayerAdded)
My character turns gray and Player.CharacterAutoLoads is not a valid member of player.
uh maybe this:
--// SERVICES
local Players = game:GetService("Players")
--// FUNCTIONS
local function CustomizeCharacterAppearance(Humanoid, PlayerName)
-- Customize character appearance
local Description = Humanoid:GetAppliedDescription()
if Description then
if PlayerName:lower() == "jerold09362" then
print("Jerold spawned with R15.")
else
-- Example: Resetting certain parts of the description
Description.Head = 0
Description.Torso = 0
Description.LeftArm = 0
Description.RightArm = 0
Description.LeftLeg = 0
Description.RightLeg = 0
-- Apply the customized description
Humanoid:ApplyDescription(Description)
end
else
warn("Failed to get description for", PlayerName)
end
end
local function SetCharacterToR15(Player)
-- Force the player's character to spawn with R15
local Char = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Char:WaitForChild("Humanoid")
if Humanoid.RigType ~= Enum.HumanoidRigType.R15 then
-- Respawn the player as R15
Player:LoadCharacter()
end
end
local function PlayerAdded(Player)
Player.CharacterAdded:Connect(function(Char)
local Humanoid = Char:WaitForChild("Humanoid")
-- Ensure R15 is applied
SetCharacterToR15(Player)
-- Customize the character
CustomizeCharacterAppearance(Humanoid, Player.Name)
end)
end
--// EVENTS/CALLS
Players.PlayerAdded:Connect(PlayerAdded)