maxDeaths = 1 game.Players.PlayerAdded:connect(function(p) local hold = Instance.new("IntValue", p) hold.Name = "Deaths" p.CharacterAdded:connect(function(c) c.Humanoid.Died:connect(function() hold.Value = hold.Value +1 if hold.Value == maxDeaths then Player:kick("I am dead. So why am I back ") end end) end) end)
the "Player" thing is underlined blue and says "unknown global 'player'" why does it say that?
You've defined player as 'p', so do p:Kick()
maxDeaths = 1 game.Players.PlayerAdded:connect(function(p) local hold = Instance.new("IntValue", p) hold.Name = "Deaths" p.CharacterAdded:connect(function(c) c.Humanoid.Died:connect(function() hold.Value = hold.Value +1 if hold.Value == maxDeaths then p:Kick("I am dead. So why am I back ") end end) end) end)
try this
maxDeaths = 1 game.Players.PlayerAdded:connect(function(p) local hold = Instance.new("IntValue", p) hold.Name = "Deaths" p.CharacterAdded:connect(function(c) c.Humanoid.Died:connect(function() hold.Value = hold.Value +1 if hold.Value == maxDeaths then do Player:kick("I am dead. So why am I back ") end end end) end)
--THIS "SHOULD" BE WRITTEN IN A SCRIPT local maxDeaths = 1 game.Players.PlayerAdded:Connect(function(p) local hold = Instance.new("IntValue", p) hold.Name = "Deaths" p.CharacterAdded:Connect(function(c) c.Humanoid.Died:Connect(function() hold.Value = hold.Value + 1 if hold.Value == maxDeaths then p:Kick("I am dead, So why am I back") end end) end) end)