https://gyazo.com/5b329d02e6ca20a7d1014c0c54cbdd6e Thats a gif for some reason, none of the less it should show you what I'm trying to do a little better.
Code I'm using: local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr.TeamColor == BrickColor.new("Maroon") then game.StarterCharacter = game.StarterCharacter1 end local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr.TeamColor == BrickColor.new("Navy blue") then game.StarterCharacter = game.StarterCharacter2 end
local rs = game.ReplicatedStorage local defend = rs.CHARACTERNAMEHERE:Clone() --Put the name of the character in "CHARACTERNAMEHERE". And put the character in ReplicatedStorage local plr = game.Players.LocalPlayer if plr.Team == game.Teams.Chaos then wait() defend.Name = plr.Name plr.Character:Destroy() plr.Character = defend plr.Character.Parent = workspace end
Here you Go. The only problem is that You need a NoRespawn script. Gotchu Covered. Also put the script inside a Localscript. andput it in "Startergui" or "StarterCharacterScripts"
local respawnTime = 99999999999999999999999999999999999999.9 local Players = game:GetService("Players") Players.CharacterAutoLoads = false Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) -- find the humanoid, and detect when it dies local Humanoid = Character:FindFirstChild("Humanoid") if Humanoid then Humanoid.Died:connect(function() -- delay, then respawn the character wait(respawnTime) Player:LoadCharacter() end) end end) Player:LoadCharacter() -- load the character for the first time end)
Put this Script in a Script and Put it in "Workspace" or "ServerScriptStorage"