I have done changes, and rechecked what I could've done wrong, but the command is not executing as it's supposed to, there is also no Output, so I do not know how to fix it, here is the script;
if msg:lower():sub(1,3+#Prefix) == Prefix.."tp " then --I know, the code looks messy ;-; print("Executed teleport") --It has printed this local chk1 = msg:lower():sub(4+#Prefix):find(" ") + 3+#Prefix local plrz = GetPlr(plr,msg:lower():sub(4,chk1-1-#Prefix)) --I think the problem is here local plrz2 = GetPlr(plr,msg:lower():sub(chk1+1+#Prefix)) --Also here print("Got past point") --It also printed this for i,v in pairs(plrz) do --So that means the problem is here coroutine.wrap(function() for i2,v2 in pairs(plrz2) do --Or here coroutine.wrap(function() if v and v2 and v.Character and v2.Character and v.Character:FindFirstChild("Torso") and v2.Character:FindFirstChild("Torso") then v.Character.Torso.CFrame = CFrame.new(v2.Character.Torso.Position + Vector3.new(0,math.random(1,2),0)) print(v.Name..", ",v2.Name..", ") --But then, I did this one to check to see if it would print the names, and it didn't print the names of the Players end end)() end end)() end end
EDIT This is the 'GetPlr' function as requested [Although, I fail to understand why it is needed];
local function GetPlr(plr,str) --TheeDeathCaster local plrz = {} if str:lower() == "all" then plrz = game.Players:GetPlayers() elseif str:lower() == "others" then for i, v in pairs(game.Players:GetPlayers()) do if v ~= plr then table.insert(plrz,v) end end else local Heh = {1} local HEH = {} for z = 1, #str do if str:sub(z,z) == "," then table.insert(Heh,z+1) table.insert(HEH,z-1) end end for x = 1, #Heh do if (Heh[x] and HEH[x] and str:lower():sub(Heh[x],HEH[x]) == "me") or (Heh[x] and str:sub(Heh[x]) == "me") then table.insert(plrz,plr) elseif (Heh[x] and HEH[x] and str:lower():sub(Heh[x],HEH[x]) == "random") or (Heh[x] and str:sub(Heh[x]) == "random") then table.insert(plrz,game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]) elseif (Heh[x] and HEH[x] and str:sub(Heh[x],HEH[x]) == "admins") or (Heh[x] and str:sub(Heh[x]) == "admins") then if ChkAdmin(plr.Name) then for i2,v in pairs(game.Players:GetPlayers()) do if v and ChkAdmin(v.Name) then table.insert(plrz,v) end end end elseif (Heh[x] and HEH[x] and str:sub(Heh[x],HEH[x]) == "nonadmins") or (Heh[x] and str:sub(Heh[x]) == "nonadmins") then if ChkAdmin(plr.Name) then for i2,v in pairs(game.Players:GetPlayers()) do if v and not ChkAdmin(v.Name) then table.insert(plrz,v) end end end elseif (Heh[x] and HEH[x] and str:sub(Heh[x],HEH[x]) == "newbs" or str:sub(Heh[x],HEH[x]) == "noobs") or (Heh[x] and str:sub(Heh[x]) == "newbs" or str:sub(Heh[x]) == "noobs") then for i2,v in pairs(game.Players:GetPlayers()) do if v and v.AccountAge < 7 then table.insert(plrz,v) end end else for j,k in pairs(game.Players:GetPlayers()) do if (Heh[x] and HEH[x] and str:sub(Heh[x],HEH[x]) ~= "" and k.Name:lower():find(str:lower():sub(Heh[x],HEH[x])) == 1) or (Heh[x] and str:sub(Heh[x]) ~= "" and k.Name:lower():find(str:lower():sub(Heh[x]))) then table.insert(plrz,k) end end end end end return plrz end