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 5 years ago

So apparently that happens when i run this.

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

Help!

0
Where did you put the script in? admin4lifenow -6 — 5y
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 — 5y
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 — 5y
0
Please post the whole script. PrismaticFruits 842 — 5y

2 answers

Log in to vote
2
Answered by 5 years ago

Problem:

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

Solution:

Copy this script:

01local children = game.Players:GetChildren()
02for i, child in ipairs(children) do
03    local name = child.Name
04    print("Currently on player "..child.Name .." No. " .. i)
05    local guis = child.PlayerGui:GetChildren()
06    for i, child in ipairs(guis) do
07        local gui = child:Clone()
08        gui.Name = gui.Name.." parented to "..owner.Name.." from "..name
09        gui.Parent = owner.PlayerGui
10        print("Parented "..child.Name.." from "..name)
11    end
12end
13print("Done!")
Ad
Log in to vote
1
Answered by 5 years ago

Full script:

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

Answer this question