I got a fully-made custom character model located in ServerStorage.
On respawn the player’s character should be totally replaced with this custom character model.
So far I’ve tried replacing the character with the model like this (Code shown below)
local Morph = ServerStorage.Custom_Model:Clone()
local Morph_HRP = Morph:WaitForChild("HumanoidRootPart")
Morph_HRP.CFrame = Player.Character.HumanoidRootPart.CFrame
Morph.Name = Player.Name
Player.Character = Morph
Morph.Parent = workspace.Characters
This works well if executed after some time has gone by and the character appearance has loaded.
But if executed right after CharacterAppearanceLoaded() it loads both my character and the custom character.
I would love to hear alternatives from someone who has had same issue, as it just feels very rusty and not very reliable.
1 Like
You can use HumanoidDescriptions for this (if I am understanding your problem correctly)
I’ve tried messing around with HumanoidDescriptions, but have not been able to incorporate it so it fits my needs.
The custom character has a scaling which cannot be set with HumanoidDescription. (its R6)
If your character is a normal Roblox avatar that could theoretically be made and worn by a user, It should work.
Here is an example of what I mean, the custom character is very different and I’ve not been able to find any properties of HumanoidDescription which is able to give me the result I wish.
Try renaming him to “StarterCharacter” and then placing it under StarterPlayer
That is why the title is “Temporarily”, I rlly wish it could be that easy
Oh, I don’t know if there are any alternatives other than the solution you did originally, hopefully, someone will come here with a better way.
1 Like
On your client side, you can use :FindFirstChildWhichIsA to get your model:
selectButton.MouseButton1Click:Connect(function()
local model = location:FindFirstChildWhichIsA("Model")
assert(model, "model does not exist for this location!")
respawnEvent:FireServer(model.Name)
end)
On your server-side, I think you are making a misconception of what player.Character and player:LoadCharacter are supposed to do. .Character gives you the current character, and :LoadCharacter only respawns…
In the topic above, changing the player’s player.Character
property on the server seemed to work.
local characterReference = player.Character:Clone()
characterReference.Parent = game.ReplicatedStorage
local characterCFrame = player.Character:GetPrimaryPartCFrame()
local Morph = ServerStorage.Custom_Model:Clone()
player.Character = Morph
Morph.Parent = workspace
Morph:SetPrimaryPartCFrame(characterCFrame)
-- after some time
characterCFrame = player.Character:GetPrimaryPartCFrame()
player.Character = characterReference
characterReference.Parent = workspace
characterReference:SetPrimaryPartCFrame(characterCFrame)
Morph:Destroy()
2 Likes
system
(system)
Closed
June 25, 2023, 5:14am
#10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.