i am trying to kick a player out of the server when he/she 's HP = 0 ,so they can't respawn anymore...
Upon the players death this will kick them
--// Author: EnzoTDZ_YT --// File: PlayerDiedKick.lua game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) Character.Humanoid.Died:Connect(function(Death) Player:Kick("You Died") end) end) end)
Put in serverscriptservice as a regular script btw didnt know people already answered i had this page open with no answers sorry if it looks like i copied.
Keep in mind that this is not request site but as this is very simple I will make it for you:
This should be in normal script placed in ServerScriptService(best choice) or Workspace
game.Players.PlayerAdded:Connect(function(Player) -- Detects when a player joins Player.CharacterAdded:Connect(function(Character) -- Detects when his character is addded Character:WaitForChild("Humanoid").Died:Connect(function() -- And when he died it will kick him Player:Kick("You died!") end) end) end)