I'm using Kohl's admin to make some of my own commands and so far, I've succeeded in most of my single argument commands. But the ones with multiple arguments look confusing and I'm not sure what they mean.
if msg:lower():sub(1,6) == "place " then local chk1 = msg:lower():sub(7):find(" ") + 6 local plrz = GetPlr(plr, msg:lower():sub(7,chk1-1)) for i, v in pairs(plrz) do coroutine.resume(coroutine.create(function() if v and v:findFirstChild("PlayerGui") then repeat wait(1/30) until v.Character game:GetService('TeleportService'):Teleport(msg:sub(chk1+1),v.Character) end end)) end end
What does the "chk1" and "plrz" mean in here? I know "plrz" is the player the script's finding but how does it find them with GetPlr(plr, msg:lower():sub(7,chk1-1))
? And same with the chk1, please do correct me if I'm wrong but that's the first argument after the command, right? How is msg:lower():sub(7):find(" ") + 6
used to find the destination of the place?
Thank you in advance. :)
String.sub is a way to get a sub string, in other words, part of the string inbetween points 6 and chk1-1