Why wont these commands work?
It isn't killing the player. Not sure why....
There are not errors.
Full Script:
002 | local Owners = { 'Player' , 'Scriptecx' } |
018 | local Players = game:GetService( 'Players' ) |
019 | local Lighting = game:GetService( 'Lighting' ) |
020 | local Debris = game:GetService( 'Debris' ) |
022 | function GetPlayers() return Players:GetPlayers() end |
024 | function CheckRank(player,rank) |
025 | for _,v in pairs (rank) do |
026 | if tonumber (v) and v = = player.userId then |
027 | print ( 'User Accepted' ) |
029 | elseif tostring (v) and v = = player.Name:lower() then |
030 | print ( 'User Accepted' ) |
038 | function getPlayer (msg, speaker) |
040 | if msg:sub( 1 , 2 ) = = "me" then return { speaker } |
041 | elseif msg:sub( 1 , 3 ) = = "all" then |
042 | for _, v in pairs (GetPlayers()) do |
043 | table.insert (Got, v) |
045 | elseif msg:sub( 1 , 6 ) = = "others" then |
046 | for _,v in pairs (GetPlayers()) do |
047 | if v ~ = speaker then table.insert (Got, v) |
050 | elseif msg:sub ( 1 , 6 ) = = "random" then |
051 | return { (Players [ math.random ( 1 , #Players:GetPlayers()) ] ) } |
052 | elseif msg:sub( 1 , 6 ) = = "admins" then |
053 | for _,v in pairs (GetPlayers()) do |
054 | if CheckRank(v, Admins) = = true or CheckRank(v, Temps) = = true or CheckRank(v, Owners) = = true or CheckRank(v, Mods) = = true then |
058 | elseif msg:sub( 1 , 6 ) = = "nonadmins" then |
059 | for _,v in pairs (GetPlayers()) do |
060 | if CheckRank(v, Admins) = = false or CheckRank(v, Temps) = = false or CheckRank(v, Owners) = = false or CheckRank(v, Mods) = = false then table.insert(Got, v) |
063 | elseif msg:sub( 1 , 5 ) = = "noobs" then |
064 | for _,v in pairs (GetPlayers()) do |
065 | if v.AccountAge < = NoobAge then |
069 | elseif msg:sub( 1 , 6 ) = = "elders" then |
070 | for _,v in pairs (GetPlayers()) do |
071 | if v.AccountAge > = NoobAge then |
076 | for _, v in pairs (GetPlayers()) do |
077 | if string.find(string.lower(v.Name),string.lower(msg)) then |
085 | function chat(str, Speaker) |
086 | local command = str:lower() |
087 | if CheckRank(Speaker,Owners) then |
088 | if command:sub ( 1 , 4 + CommandPrefix:len()) = = CommandPrefix.. "kill" then |
089 | local player = getPlayer(command:sub( 4 + #CommandPrefix + 1 ), Speaker) |
091 | for _, p in pairs (player) do player.Character:BreakJoints() end |
097 | Players.PlayerAdded:connect( function (plr) |
098 | plr.Chatted:connect( function (str) |