I tried this:
01 | function findPlayer(name) |
02 | for _, player in ipairs (game.Players:GetPlayers()) do |
03 | if player.Name:lower() = = name:lower() then |
04 | return player |
05 | end |
06 | end |
07 | end |
08 |
09 | game.Players.PlayerAdded:connect( function (plr) |
10 | plr.Chatted:connect( function (msg) |
11 | if msg:sub( 1 , 5 ) = = ";kill" then |
12 | victim = findPlayer(msg:sub( 7 )) |
13 | if victim and victim.Character then |
14 | victim.Character:BreakJoints() |
15 | end |
16 | end |
17 | end ) |
18 | end ) |
but I always get a error saying