Search code examples
luaroblox

How can I "ApplyDescription()" locally?


I want to make a cutscene system in Roblox Studio by loading in the player's character locally onto a dummy in the Workspace before anything else; an identical clone (same RigType, avatar proportions, etc.) of the player character is what I want but the only problem is that I can't use

ApplyDescription()

from the client, and it won't be multiplayer-friendly if I use the server because I'm pretty sure it'll either break from not being able to choose a player or use one player's character and it won't look good for the others. How can I achieve this?

TLDR: How can I make a Dummy in Workspace look like each player's character only for themselves in Roblox Studio?

Here is the LocalScript I tried to use from StarterPlayerScripts:

local players = game:GetService("Players")
local rig = workspace:WaitForChild("Rig")
local humanoid = rig:WaitForChild("Humanoid")

task.wait(10)
local desc = players:GetHumanoidDescriptionFromUserId(game.Players.LocalPlayer.UserId)
humanoid:ApplyDescription(desc)

I was expecting it to work without any problem. After the wait, the script should work, right? No, of course not. ApplyDescription() can only be called by the backend server.


Solution

  • I already tried using this function after I posted this, but thanks anyway. I was able to accomplish my goal as wanted by going back and forth with the clients and server using RemoteEvents.