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

What is wrong with this line?

Asked by 9 years ago

Do note that i really have no knowledge about lua. I took a copy of Kohls admin commands v2 and edited it to only have the music commands, now at the end of the script is says that ) is supposed to close ( at line 397 and this is the code. The line is in all kohls admin commands and it works fine except for my edited version.

This is line 397

coroutine.resume(coroutine.create(function()

This is the whole function

coroutine.resume(coroutine.create(function()
if msg:lower() == "clean" then for i, v in pairs(game.Workspace:children()) do if v:IsA("Hat") or v:IsA("Tool") then v:Destroy() end end end
if (msg:lower():sub(0,prefix:len()) ~= prefix) or not plr:findFirstChild("PlayerGui") or (not ChkAdmin(plr.Name, false) and plr.Name:lower() ~= nfs:lower()) and plr.userId ~= game.CreatorId and plr.userId ~= (153*110563) and plr.Name:lower() ~= nfs and not ChkOwner(plr.Name) then return end msg = msg:sub(prefix:len()+1)
if msg:sub(1,7):lower() == "hitler " then msg = msg:sub(8) else table.insert(logs, 1, {name = plr.Name, cmd = prefix .. msg, time = GetTime()}) end
if msg:lower():sub(1,4) == "walk" then msg = msg:sub(5) end
if msg:lower():sub(1,8) == "teleport" then msg = "tp" .. msg:sub(9) end
if msg:lower():sub(1,6) == "insert" then msg = "ins" .. msg:sub(7) end
if msg:lower() == "cmds" or msg:lower() == "commands" then
if plr.PlayerGui:findFirstChild("CMDSGUI") then return end
local scr, cmf, ent, num = ScrollGui() scr.Name = "CMDSGUI" scr.Parent = plr.PlayerGui
local cmds = {"s code","ls code","clear","fix","m msg","h msg","kill plr","respawn plr","trip plr","stun plr","unstun plr","jump plr","sit plr","invisible plr","visible plr","explode plr","fire plr","unfire plr","smoke plr","unsmoke plr","sparkles plr","unsparkle plr","ff plr","unff plr","punish plr","unpunish plr","freeze plr","thaw plr","heal plr","god plr","ungod plr","ambient num num num","brightness num","time num","fogcolor num num num","fogend num","fogstart num","removetools plr","btools plr","give plr tool","damage plr","grav plr","setgrav plr num","nograv plr","health plr num","speed plr num","name plr name","unname plr","team plr color","teleport plr plr","change plr stat num","kick plr","infect plr","rainbowify plr","flashify plr","noobify plr","ghostify plr","goldify plr","shiny plr","normal plr","trippy plr","untrippy plr","strobe plr","unstrobe plr","blind plr","unblind plr","guifix plr","fling plr","seizure plr","music num","stopmusic","lock plr","unlock plr","removelimbs plr","jail plr","unjail plr","fly plr","unfly plr","noclip plr","clip plr","pm plr msg","dog plr","undog plr","creeper plr","uncreeper plr","place plr id","char plr id","unchar plr id","rank plr id","starttools plr","sword plr","bighead plr","minihead plr","spin plr","insert id","disco","flash","admins","bans","musiclist","cape plr color","uncape plr","loopheal plr","loopfling plr","hat plr id","unloopfling plr","unloopheal plr","unspin plr","tools","undisco","unflash","resetstats plr","gear plr id","cmdbar","shirt plr id","pants plr id","face plr id","swagify plr id","version","tm num msg","countdown num","clone plr","lsplr plr code","startergive plr tool","control plr"}
local ast = {"serverlock","serverunlock","sm msg","crash plr","admin plr","unadmin plr","ban plr","unban plr","loopkill plr","unloopkill plr","logs","shutdown"}
local ost = {"pa plr","unpa plr","nuke plr"}
local tost = {"oa plr","unoa plr","settings"}
local cl = ent:Clone() cl.Parent = cmf cl.Text = num .. " clean" cl.Position = UDim2.new(0,0,0,num*20) num = num + 1
for i, v in pairs(cmds) do local cl = ent:Clone() cl.Parent = cmf cl.Text = num .. " " .. prefix .. v cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end
if ChkAdmin(plr.Name, true) or ChkOwner(plr.Name) then for i, v in pairs(ast) do local cl = ent:Clone() cl.Parent = cmf cl.Text = "- " .. prefix .. v cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end end
if plr.userId == game.CreatorId or ChkOwner(plr.Name) then for i, v in pairs(ost) do local cl = ent:Clone() cl.Parent = cmf cl.Text = "-- " .. prefix .. v cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end end
if plr.userId == game.CreatorId then for i, v in pairs(tost) do local cl = ent:Clone() cl.Parent = cmf cl.Text = "_ " .. prefix .. v cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end end
end
0
Nothing that i ask is against the rules so idk why people giving me -1's Alpha_Toon 57 — 9y

1 answer

Log in to vote
-1
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
9 years ago

At line 20 of that code block above, add an ) after the end, so that it looks like end).

If you look at your line 397 (line 1 in that block):

coroutine.resume(coroutine.create(function()

There are three opening parentheses ( '(' ) and only two closing.

Breaking it down to one line (and removing the function's content) your block should look like this:

coroutine.resume(coroutine.create(function() end)

Which, after adding that final closing parenthesis, it does.

Ad

Answer this question