Hi guys.
I often enough use player’s character’s dummy. Like mannequin - for tutorial, for inventory, for player list…
And out of nothing, code in singular instance has decided to not work: inventory equipment panel:
coroutine.wrap(function()
local Rig = GuiSections.Equipment.Parent:WaitForChild("CharacterBackground"):WaitForChild("Rig")
local Humanoid:Humanoid = Rig:WaitForChild("Humanoid")
local Appearence = Players:GetHumanoidDescriptionFromUserId(Player.UserId)
Humanoid:ApplyDescription(Appearence)
end)()
While, for example, tutorial works well:
local Appearence = Players:GetHumanoidDescriptionFromUserId(Player.UserId)
local Character = Assets.BaseCharacter:Clone()
Character:PivotTo(Island.SpawnPad:GetPivot() * CFrame.new(0, Character:GetExtentsSize().Y/2, 0))
Character.Humanoid.WalkSpeed = 10
Character.Parent = TutorialFolder
Character:WaitForChild("Humanoid"):ApplyDescription(Appearence)
Parameters.Character = Character
Both scripts are ModuleScripts, under control of LocalScript, and I expect them to work both. But why first one gives error
Humanoid::ApplyDescription() can only be called by the backend server
while second just works?
just use task.spawn as this point
coroutines is for “lower level” tasks such as yielding current thread etc.
This means that ApplyDescriptionn can only be ran on the server
WAIT NVM
There is 2nd argument
try adding as second argument: Enum.AssetTypeVerification.ClientOnly
Personal preference of using coroutines.
Yes, I looked at that error and other posts. But WHY IN THE WORLD one of LocalScripts don’t works with that method, while OTHER ones work? They all are LOCAL scripts:
i dont like when people are stubborn like that and close minded
Did you read my reply fully?
1 Like
Yep, there’s not much people more stubborn than me. Sorry for that.
(I have found that coroutines can yield current thread around 2 weeks ago, after 3 years of painfull workarounds =D )
No, at that moment I have not noticed your edit.
Anyways, adding Enum not helped, error stays.
I have found bypass to that limitation - if dummy rig is CLONED, and then THAT rig attempted to apply humanoid description, it will work.
That’s why all my other scripts were working.
they cant tho…
Coroutine cannot yield current thread
the one that errors, is it required by the server? Humanoid::ApplyDescription
will always error on the client, it makes sense it’s not working.
coroutine.yield()
1 Like
I meant that if you use it inside function, which was called by event, like MouseButton1Click, then you can yield it, and resume it later.
Anyways that’s a bit of offtopic