Hello!
For a while now, I’ve been attempting to make a custom character loader, which could apply the rig to a specific person with a specific UserId.
I have tried several methods. However, none of them seem to work efficiently.
The closest I’ve gotten was using a method that users a local script, server script, and remote event, all placed in startergui:
Local Script:
wait(0.01)
local plr = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local rig = game.Workspace.Barb
local plrID = game.Players:GetUserIdFromNameAsync(plr.Name)
print(plrID)
if plrID == 535755127 then
camera.CameraType = "Follow"
camera.CameraSubject = rig.HumanoidRootPart
script.Parent.RemoteEvent:FireServer()
end
Server script:
local dontrepeat
script.Parent.RemoteEvent.OnServerEvent:Connect(function(plr)
local char = plr.Character
local rig = game.Workspace.Barb
if not rig.HumanoidRootPart:FindFirstChild("DontRepeat") then
plr.Character = rig
end
wait()
if not rig.HumanoidRootPart:FindFirstChild("DontRepeat") then
dontrepeat = Instance.new("Attachment")
dontrepeat.Name = "DontRepeat"
dontrepeat.Parent = rig.HumanoidRootPart
wait()
char:Destroy()
end
end)
And while this somewhat worked, when I apply an animation script, it’s very delayed, and on some rigs, the walking animation doesn’t even work.
If anyone knows a more efficient way to load a custom character through a script, that would be helpful. Thank you!