Player kick system is not working

I know this us dumb question but i need help

game.Players.PlayerAdded:Connect(function(p)
	local name = p.Name
	game.Players.name:Kick("Kick message")
end)

this is on ServerScriptService
What should i fix?

1 Like

you can just do:

game.Players.PlayerAdded:Connect(function(p)
	local name = p.Name
	p:Kick("Kick message")
end)

and the problem is becuz you should do game.Players[name]:Kick("Kick message")

2 Likes