hello im trying to make make it so that if a player touches a part they get kicked but im having problems, sometimes it will just kick player the moment the player enters game or it just doesnt work
script.Parent.Touched:Connect(function(hit)
local playe = hit.Parent:FindFirstChild("Humanoid")
game:GetService("Players").PlayerAdded:Connect(function(playe)
playe.Players:Connect(function(char)
char:WaitForChild("Humanoid").Touched:Connect(function()
playe:Kick("Trolled")
end)
end)
end)
end)