if player.Name == "Player 1" then player:Kick("This is a test") end
Player is not in any hierarchy or even exists. Player is not identified. Here is an example of a script that identifies and kicks the player if it's Player 1:
game.Players.PlayerAdded:connect(function(player) if player.Name == "Player 1" then player:Kick("This is a test") end end)
Or if it's a LocalScript:
local player = game.Players.LocalPlayer if player.Name == "Player 1" then player:Kick("This is a test") end