So, I made a LocalScript in Workspace to fire a RemoteEvent in ReplicatedStorage to change the players character when the character joins, here is an example:
local player = game.Players.LocalPlayer
local Event = game.ReplicatedStorage.MorphEvent
local Morph = Event.Parent.Characters.Morph
player.CharacterAdded:Wait()
Event:FireServer(Morph)
LocalScripts don’t run in Workspace. Parent it to something like PlayerGui.
Also, I recommend using Players.CharacterAdded in a Players.PlayerAdded event so that you can make your code format easier to understand and practically performance wiser.
it’s still not working.
maybe it has something to do with my Event Script:
local Storage = game.ReplicatedStorage
Storage.MorphEvent.OnServerEvent:Connect(function(Player,Morph: Morph)
local Character = Player.Character
local HumanoidRootPart = Character:WaitForChild("Head")
local MorphClone = Morph:Clone()
HumanoidRootPart.Anchored = true
wait(1)
MorphClone.Name = Player.Name .. ""
MorphClone:WaitForChild("Head").Position = HumanoidRootPart.Position
MorphClone.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.Viewer
local ActivateBackpack = Player.Backpack:GetChildren()
local Folder = Instance.new("Folder")
Folder.Parent = game.ServerStorage
Folder.Name = Player.Name
for i,Tool in pairs(ActivateBackpack) do
Tool:Clone().Parent = Folder
end
local success, err = pcall(function()
Character:FindFirstChildOfClass("Tool"):Clone().Parent = MorphClone
end)
Player.Character = MorphClone
local MorphBackpack = Player.Backpack:GetChildren()
MorphClone.Parent = workspace
MorphClone.Animate.Disabled = false
for i,Tool in pairs(MorphBackpack) do
Tool:Destroy()
end
for i,Tool in pairs(game.ServerStorage:WaitForChild(Player.Name):GetChildren()) do
Tool:Clone().Parent = Player.Backpack
end
game.ServerStorage:WaitForChild(Player.Name):Destroy()
for i,Part in pairs(MorphClone:GetChildren()) do
if Part.ClassName == "Part" or Part.ClassName == "UnionOperation" or Part.ClassName == "MeshPart" then
Part.Anchored = false
end
end
end)
are you sure HumanoidRootPart is supposed to be the player’s head?
Also you should be using task.wait() as its more precise and less laggy than wait()