You can write your topic however you want, but you need to answer these questions:
-
A character changer which changes the players character to a randomized character in a folder.
-
When I put a Spawnlocation somewhere and I hit play it does not spawn me at the Spawnlocation
-
I tried switching the SetPrimaryPartCFrames line.
local plrs = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local starterCharacterFolder = RS:WaitForChild("Folder")
local function randomCharacter()
return starterCharacterFolder:GetChildren()[math.random(1,#starterCharacterFolder:GetChildren())]
end
plrs.PlayerAdded:Connect(function(plr)
local debounce = false
plr.CharacterAdded:Connect(function()
if not debounce then
debounce = true
local char1 = plr.Character
local morph = randomCharacter():Clone()
morph.HumanoidRootPart.Anchored = false
morph:SetPrimaryPartCFrame(plr.Character.PrimaryPart.CFrame)
morph.Name = plr.Name
plr.Character = morph
morph.Parent = workspace
if char1 then
char1:Destroy()
end
end
local hum = plr.Character:WaitForChild("Humanoid")
hum.Died:Connect(function()
debounce = false
end)
end)
end)