Hi, so I'm trying to make something that allows someone to have an r6 hitbox, while keeping their R15 appearance and animations. To do this, I've made their character R6, made them invisible, made a copy of what their actual R15 character should look like, welded their root parts together, and put the R15 rig inside of their character (as a child), and finally I modified the animation script so it would play the animations on the fake r15 character instead. The modified animation script is too long to post here, but the server-side script isn't too long.
local function newchar(plr)
local uid = plr.UserId
local charinfo = game:GetService("Players"):GetCharacterAppearanceInfoAsync(uid)
local avatartype = charinfo.playerAvatarType
if avatartype == "R6" then
plr:LoadCharacter()
if not plr.Character then
plr.CharacterAdded:Wait()
end
local connection
connection = plr.Character:WaitForChild("Humanoid").Died:Connect(function()
connection:Disconnect()
newchar(plr)
end)
elseif avatartype == "R15" then
local char = game:GetService("ServerStorage").CustomChar:Clone()
char.Name = plr.Name
char.Parent = workspace
plr.Character = char
local humdesc = game:GetService("Players"):GetHumanoidDescriptionFromUserId(uid)
-- Makes the character invisible
plr:ClearCharacterAppearance()
for i,v in pairs(char:GetChildren()) do
if v:IsA("Part") then
-- Removes meshes that may cause a problem in the next step
for i2,v2 in pairs(v:GetChildren()) do
if v2:IsA("BlockMesh") or v2:IsA("SpecialMesh") then
v2:Destroy()
end
end
-- Makes invisible
Instance.new("SpecialMesh", v).Scale = Vector3.new(0,0,0)
-- Hide name
char.Head.Transparency = 1
end
end
local fchar = game:GetService("ServerStorage").R15:Clone()
fchar.Name = plr.Name
fchar.Parent = game:GetService("ServerStorage").Temp
fchar.Humanoid:ApplyDescription(humdesc)
for i,v in pairs(fchar:GetChildren()) do
if v:IsA("BasePart") then
game:GetService("PhysicsService"):SetPartCollisionGroup(v, "NonCollidable")
end
end
fchar.Humanoid.PlatformStand = true
fchar.Parent = char
local weld = Instance.new("Weld")
weld.Part0 = char.HumanoidRootPart
weld.Part1 = char[plr.Name].HumanoidRootPart
weld.C0 = CFrame.new(0,char[plr.Name].Humanoid.HipHeight-2,0)
weld.Parent = char.HumanoidRootPart
local connection
connection = char.Humanoid.Died:Connect(function()
connection:Disconnect()
newchar(plr)
end)
for i,v in pairs(fchar:GetChildren()) do
if v:IsA("BasePart") then
v:SetNetworkOwner(plr)
end
end
end
end
game:GetService("Players").PlayerAdded:Connect(newchar)
the place is here by the way (it's uncopylocked so you can view it in studio).
oh also I'm just looking for any suggestions on what I could try in order to fix it.
Thanks
