Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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!

4 comments

0

Where did you put the script in?

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

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?

0

Please post the whole script.

2 answers

✓ Accepted answer

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!")

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!")

2 comments

1

You forgot the () after the GetChildren on line 5.

0

Post this as an edit to the question

This discussion is preserved as it was. New answers, comments, and votes are closed.