Script works but errors

I am changing to a blocky R6 character.

It works on Play.

It works on Respawn, but there is an error in the output window:

  16:53:13.297  **Humanoid::ApplyDescription() DataModel was not available**  -  Server - Player:32

I have read every forum post I can find on it:

– The parent of Humanoid is not nil. ( 16:53:13.294 Humanoid Parent == mc7oof - Server - Player:30)
— Adding a task.wait() does not fix it.

Here is the code:




local Players = game:GetService("Players")

local function PlayerAdded(Player)

	local RESPAWN_DELAY = 4
	Players.CharacterAutoLoads = false
	Player.RespawnLocation = game.Workspace.SpawnLocation

	local function CharacterAdded(Character)

		local function HumanoidDied(Character)
			task.wait(RESPAWN_DELAY)
			Player:LoadCharacter()
		end
		local Humanoid = Character:WaitForChild("Humanoid")
		Humanoid.Died:Connect(HumanoidDied)

		local function AppearanceLoaded()
			local CurrentDescription = Humanoid:GetAppliedDescription()
			CurrentDescription.Head = 0
			CurrentDescription.Torso = 0
			CurrentDescription.LeftArm = 0
			CurrentDescription.RightArm = 0
			CurrentDescription.LeftLeg = 0
			CurrentDescription.RightLeg = 0
			
			print("Humanoid Parent ==", Humanoid.Parent)

			Humanoid:ApplyDescription(CurrentDescription)
		end
		Player.CharacterAppearanceLoaded:Connect(AppearanceLoaded)

	end
	Player.CharacterAdded:Connect(CharacterAdded)
	Player:LoadCharacter()

end
for _, Player in Players:GetPlayers() do
	task.spawn(PlayerAdded, Player)
end
Players.PlayerAdded:Connect(PlayerAdded)

Here is the file:
R6.rbxl (54.4 KB)

Respawn and you will see the error, but the character will be blocky, as intended.

1 Like

are you trying to make player spawn as a blocky r6 character or just want removing all of their accessory

Spawn as blocky R6 each time.

Right now it spawns the first time correctly.

The second time also, but there is an error message (even though it actually works).

cant you just change to r6 in settings? or am i missing something?

The game is set to R6.

The character spawns with a “blocky” look as intended.

It also respawns with the blocky look.

The problem is the Output window shows an error.

The line with the error is:

Humanoid:ApplyDescription(CurrentDescription)

The error message is:

16:53:13.297 **Humanoid::ApplyDescription() DataModel was not available** - Server - Player:32

But, the character spawns with the block mesh as intended, so the error makes no sense.

if Humanoid:FindFirstChild("HumanoidDescription") then
	for _, Body in pairs(Humanoid.HumanoidDescription:GetChildren()) do
		if Body:IsA("BodyPartDescription") and Body.BodyPart ~= Enum.BodyPart.Head then
			Body.AssetId = 0
		end
	end
end

As soon as I posted the above as the solution it stopped working.

I just wrapped it in a pcall to stop the error instead:

local CurrentDescription = Humanoid:GetAppliedDescription()
CurrentDescription.Head = 0
CurrentDescription.Torso = 0
CurrentDescription.LeftArm = 0
CurrentDescription.RightArm = 0
CurrentDescription.LeftLeg = 0
CurrentDescription.RightLeg = 0			
local Success = pcall(function() return Humanoid:ApplyDescription(CurrentDescription) end)
if Success then Humanoid:ApplyDescription(CurrentDescription) end

Would be nice to know why there is an error to begin with.

Finally figured this one out.

local function CharacterAdded(Character)
	local function AppearanceLoaded(Character) -- character needed here
		local Humanoid = Character:WaitForChild("Humanoid") -- humanoid defined here
	Player.CharacterAppearanceLoaded:Connect(AppearanceLoaded)
Player.CharacterAdded:Connect(CharacterAdded)

Now it doesn’t error. :smiley:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.