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

Expected '(', '{', or <string> got 'for'? Please help!

Asked by 4 years ago

So apparently that happens when i run this.

    for i, child in ipairs(guis) do
        local gui = child:Clone()
        gui.Name = gui.Name.." parented to "..owner.Name.." from "..name
        gui.Parent = owner.PlayerGui
        print("Parented "..child.Name.." from "..name)
    end

Help!

0
Where did you put the script in? admin4lifenow -6 — 4y
0
it's a casual workspace script if i need to i can post the whole script, just trying to make a manual anti exploit iiDkOffical 109 — 4y
0
you have to provide more tools for us to work with like what line did the problem happen at? what does variable "guis" define to? 123nabilben123 499 — 4y
0
Please post the whole script. PrismaticFruits 842 — 4y

2 answers

Log in to vote
2
Answered by 4 years ago

Problem:

The problem was you forgot the () at line 5, all credit to @killerbrenden

Solution:

Copy this script:

local children = game.Players:GetChildren()
for i, child in ipairs(children) do
    local name = child.Name
    print("Currently on player "..child.Name .." No. " .. i)
    local guis = child.PlayerGui:GetChildren()
    for i, child in ipairs(guis) do
        local gui = child:Clone()
        gui.Name = gui.Name.." parented to "..owner.Name.." from "..name
        gui.Parent = owner.PlayerGui
        print("Parented "..child.Name.." from "..name)
    end
end
print("Done!")
Ad
Log in to vote
1
Answered by 4 years ago

Full script:

local children = game.Players:GetChildren()
for i, child in ipairs(children) do
    local name = child.Name
    print("Currently on player "..child.Name .." No. " .. i)
    local guis = child.PlayerGui:GetChildren
    for i, child in ipairs(guis) do
        local gui = child:Clone()
        gui.Name = gui.Name.." parented to "..owner.Name.." from "..name
        gui.Parent = owner.PlayerGui
        print("Parented "..child.Name.." from "..name)
    end
end
print("Done!")
1
You forgot the () after the GetChildren on line 5. killerbrenden 1537 — 4y
0
Post this as an edit to the question hiimgoodpack 2009 — 4y

Answer this question