2022-10-13 18:26:11 -05:00
|
|
|
--!strict
|
|
|
|
|
|
|
|
local Players = game:GetService("Players")
|
2023-07-07 22:01:02 -05:00
|
|
|
local StarterPlayer = game:GetService("StarterPlayer")
|
|
|
|
local PhysicsService = game:GetService("PhysicsService")
|
|
|
|
local StarterCharacterScripts = StarterPlayer.StarterCharacterScripts
|
2022-10-13 18:26:11 -05:00
|
|
|
|
|
|
|
local hDesc = Instance.new("HumanoidDescription")
|
|
|
|
hDesc.HeightScale = 1.3
|
|
|
|
hDesc.WidthScale = 1.3
|
|
|
|
hDesc.DepthScale = 1.4
|
|
|
|
hDesc.HeadScale = 2
|
|
|
|
|
|
|
|
local character = Players:CreateHumanoidModelFromDescription(hDesc, Enum.HumanoidRigType.R15)
|
|
|
|
local bodyColors = character:FindFirstChildOfClass("BodyColors")
|
|
|
|
local animate = character:FindFirstChild("Animate")
|
|
|
|
local oldRoot = character.PrimaryPart
|
|
|
|
|
|
|
|
if animate then
|
|
|
|
animate:Destroy()
|
|
|
|
end
|
|
|
|
|
|
|
|
if oldRoot then
|
|
|
|
oldRoot:Destroy()
|
|
|
|
end
|
|
|
|
|
|
|
|
if bodyColors then
|
|
|
|
bodyColors:Destroy()
|
|
|
|
end
|
|
|
|
|
2023-07-07 22:01:02 -05:00
|
|
|
local newRoot = script.HumanoidRootPart
|
2022-10-13 18:26:11 -05:00
|
|
|
newRoot.Parent = character :: any
|
|
|
|
|
|
|
|
local humanoid = assert(character:FindFirstChildOfClass("Humanoid"))
|
|
|
|
humanoid:BuildRigFromAttachments()
|
|
|
|
|
2023-07-07 22:01:02 -05:00
|
|
|
local dummyScripts = {
|
|
|
|
"Animate",
|
|
|
|
"Health",
|
|
|
|
"Sound",
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, dummy in dummyScripts do
|
|
|
|
local stub = Instance.new("Hole", StarterCharacterScripts)
|
|
|
|
stub.Name = dummy
|
|
|
|
end
|
|
|
|
|
|
|
|
for _, child in script:GetChildren() do
|
|
|
|
child.Parent = StarterCharacterScripts
|
|
|
|
|
|
|
|
if child:IsA("Script") then
|
|
|
|
child.Disabled = false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-10-13 18:26:11 -05:00
|
|
|
character.Name = "StarterCharacter"
|
|
|
|
character.PrimaryPart = newRoot
|
|
|
|
character.Parent = StarterPlayer
|
|
|
|
|
2023-07-07 22:01:02 -05:00
|
|
|
PhysicsService:RegisterCollisionGroup("Player")
|
2022-10-13 18:26:11 -05:00
|
|
|
PhysicsService:CollisionGroupSetCollidable("Default", "Player", false)
|
2023-07-07 22:01:02 -05:00
|
|
|
|
|
|
|
for _, player in Players:GetPlayers() do
|
|
|
|
task.spawn(player.LoadCharacter, player)
|
|
|
|
end
|