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

script not detecting when child is added into workspace folder?

game.Workspace.Tycoons.ChildAdded:Connect(function(Tycoon)
	print(Tycoon)
end)

This script which is located in workspace does not detect when a child / model is added into a certain folder in Workspace. but it does detect any child added INTO workspace, not a folder. What is the issue here?

FULL CODE:

local num = 0

game.Workspace.Tycoons.ChildAdded:Connect(function(Tycoon)
	local startbutton = script.Parent[num]

	local Name = Tycoon.Owner.Value
	local Button = startbutton:Clone()

	num += 1

	Button.Parent = script.Parent
	Button.OwnerV.Value = Tycoon.Owner.Value
	Button.Owner.Text = Tycoon.Owner.Value
	Button.Name = num

	Button.Position = startbutton.Positon + UDim2.new(0,0,100,0)
	Button.BackgroundTransparency = 0
	Button.Owner.TextTransparency = 0
end)

1 comment

0

If you're wondering, the child that is being added into the folder is named from players joining. Etc, john2512, and its a model with other parts inside of it. I'm only trying to detect if A CHILD is added into the folder though.

1 answer

You need quotation marks around Tycoon on line 2. This happens because you defined tycoon in line one so when you reference it in line 2 it thinks you are trying to print what you defined.

5 comments

0

print(Tycoon.Name) doesnt work either?

0

I would need more of the code to see what you are trying to do

0

local num = 0 game.Workspace.Tycoons.ChildAdded:Connect(function(Tycoon) local startbutton = script.Parent[num] local Name = Tycoon.Owner.Value local Button = startbutton:Clone() num += 1 Button.Parent = script.Parent Button.OwnerV.Value = Tycoon.Owner.Value Button.Owner.Text = Tycoon.Owner.Value Button.Name = num Button.Position = startbutton.Positon + UDim2.new(0,0,100,0) Button.B

0

I posted the full code on the comment

0

I don't think he's trying to print a string.

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