How could i hide those two things? CloneChar → Health bar and player parts when die?
Hello! I would like to know how to hide these two things when player die, could someone help me with that, please
Code → ServerScript
-- Set CharacterAutoLoads to false
game.Players.CharacterAutoLoads = false
-- Remove player's character from workspace on death
game.Players.PlayerAdded:Connect(function(player)
while true do
local char = player.CharacterAdded:wait()
char.Humanoid.Died:Connect(function()
-- COPY
char.Archivable = true
local ClonedChar = char:Clone()
ClonedChar.Parent = workspace
-- I NEED IT HERE
wait(10)
player:LoadCharacter()
end)
end
end)
-- Respawn all dead players once every 10 seconds
while true do
local players = game.Players:GetChildren()
-- Check if each player is dead by checking if they have no character, if dead load that player's character
for i, player in pairs (players) do
if (not game.Workspace:FindFirstChild(player.Name)) then
player:LoadCharacter()
end
end
-- Wait 10 seconds until next respawn check
wait(0)
end