Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What do the following arguments mean in this?

Asked by 9 years ago

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. :)

1
 No one will be able to tell you anything about GetPlr because you didn't post the GetPlr function. I hate Kohls admin, it's so messy with horrible variable names and lots of deprecated methods. Perci1 4988 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

String.sub is a way to get a sub string, in other words, part of the string inbetween points 6 and chk1-1

Ad

Answer this question