Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fakeChar = game.ServerStorage.CustomCharacter -- The character to load
- local respawnTime = 2.5 -- How many seconds the player remains dead before they respawn
- game.Players.CharacterAutoLoads = false -- Disable default character loading
- function playerAdded(player)
- if player.Character and player.Character.Parent then -- Destroy an already-existing character
- player.Character:Destroy()
- end
- while player.Parent do -- Repeat until they leave the game
- loadChar(player) -- Method waits until they die
- game.StarterPack.Claw.Enabled = true
- wait(respawnTime)
- end
- end
- function loadChar(player)
- local char = fakeChar:clone()
- char.Name = player.Name
- char.Humanoid.WalkSpeed = 12
- local humanoid
- for i, child in pairs(char:GetChildren()) do -- Find the humanoid
- if child.ClassName == "Humanoid" then
- humanoid = child
- break
- end
- end
- if not humanoid then -- If no humanoid was found, make one
- humanoid = Instance.new("Humanoid", char)
- end
- player.Character = char
- char.Parent = game.Workspace
- humanoid.Died:wait() -- Wait until they die
- end
- game.Players.PlayerAdded:connect(playerAdded)
- for i, player in pairs(game.Players:GetPlayers()) do -- Play Solo support
- if player.Character then
- player.Character:Destroy()
- end
- playerAdded(player)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement