why will the player:kick work here?
1 | game.Players.PlayerAdded:connect( function (player) |
2 | player.Chatted:connect( function (msg) |
3 | if (msg = = "I dont feel so good" ) then |
4 | player:kick ( "Thanos Snapped" ) |
5 | end |
6 | end ) |
7 | end ) |
and not here
1 | function clicked() |
2 | player:kick ( "oof" ) |
3 | end |
4 | script.Parent.MouseButton 1 Click:Connect(clicked) |
pls help
"player" is not defined. Put this in a localscript:
1 | local player = game.Players.LocalPlayer |
2 |
3 | function clicked() |
4 | player:kick ( "oof" ) |
5 | end |
6 | script.Parent.MouseButton 1 Click:Connect(clicked) |