Hello Developers!,
so im trying to use players char in the viewport using npc
for example:
it did not display the player using this method(its a server script in the npc):
game.Players.PlayerAdded:Connect(function(plr)
local UserId = plr.UserId
local Humanoid = script.Parent.Humanoid
local HumanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(UserId)
Humanoid:ApplyDescription(HumanoidDescription)
end)
do you know how to fix this problem?, thank you!
have you tried
local HumanoidDescription = game.Players:GetCharacterAppearanceInfoAsync(UserId)
2 Likes
i tried but it didnt work
theres no errors tho
So ok, while i try to fix this issue, Are you aware that each time a different player join, the so called npc
will turn into the newly joined player?
And maybe for a last fix, wait for the player’s character to be loaded and then pass the Humanoid Description
It should be something along the lines :
local Dummy : Model = script.Parent
local Humanoid : Humanoid = Dummy:WaitForChild("Humanoid")
local playerService = game:GetService("Players")
playerService.PlayerAdded:Connect(function(plr)
local character : Model = plr.Character or plr.CharacterAdded:Wait() or workspace:FindFirstChild(plr.Name)
local charhum : Humanoid = character:WaitForChild("Humanoid")
if character and charhum then
local humdesc = playerService:GetHumanoidDescriptionFromUserId(plr.UserId)
Humanoid:ApplyDescription(humdesc)
end
end)
no, only using the local player’s character
and also
the code isnt working its still the same as dummy
So, how would the dummy replicate into the player’s viewport frame, as far as i know;
You need to parent instance you want to be viewed inside a viewport frame into the viewport frame itself. Or im just wrong here
just found the solution of it, thanks for helping tho
1 Like