ChildAdded function not triggering

In that case if you are trying to get the table of the module then you should do:

for i, v in pairs(reqs[Table]) do

end

If it doesn’t work tell me

1 Like

The way I did it worked in other scripts, but it doesn’t work here since the “ChildAdded” event doesn’t trigger for some reason.

1 Like

It did trigger, it just broke because you are trying to get the table of a ModuleScript and you didn’t even specify which table.

1 Like

Did it print “child added” when an object has been parented to TeamHolder?

1 Like

But it worked in another script, it’s typed completely the same. The script IS the table, here’s the module script;

local module = {
	{
		TeamName = "Patient",
		GroupId = 0,
		RankRequirement = 0,
		GamepassId = 0,
		AllAllowed = true
	},
	{
		TeamName = "Intensive Care Patient",
		GroupId = 33504510,
		RankRequirement = 255,
		GamepassId = 690258455,
		AllAllowed = false
	},
	{
		TeamName = "Registered Nurse",
		GroupId = 33504510,
		RankRequirement = 25,
		GamepassId = 690297063,
		AllAllowed = false
	},
	{
		TeamName = "Medical Doctor",
		GroupId = 33504510,
		RankRequirement = 30,
		GamepassId = 682853021,
		AllAllowed = false
	},
	{
		TeamName = "Security Officer",
		GroupId = 33504510,
		RankRequirement = 35,
		GamepassId = 682486715,
		AllAllowed = false
	},
	{
		TeamName = "Specialized Response Team",
		GroupId = 33504510,
		RankRequirement = 40,
		GamepassId = 682348986,
		AllAllowed = false
	},
	{
		TeamName = "Biohazards Lab Agent",
		GroupId = 33504510,
		RankRequirement = 45,
		GamepassId = 682830122,
		AllAllowed = false
	},
	{
		TeamName = "Hospital Administration",
		GroupId = 33504510,
		RankRequirement = 50,
		GamepassId = 682730240,
		AllAllowed = false
	},
	{
		TeamName = "Medical Director",
		GroupId = 33504510,
		RankRequirement = 55,
		GamepassId = 690434031,
		AllAllowed = false
	},
	{
		TeamName = "Hospital President",
		GroupId = 33504510,
		RankRequirement = 60,
		GamepassId = 690442131,
		AllAllowed = false
	},
	{
		TeamName = "Co Owners",
		GroupId = 33504510,
		RankRequirement = 65,
		GamepassId = 690237608,
		AllAllowed = false
	},
	{
		TeamName = "Chairperson",
		GroupId = 33504510,
		RankRequirement = 600, --70
		GamepassId = 690238494,
		AllAllowed = false
	},
}

return module

I’m not sure how I can specify which table I’m trying to get when the script looks like this

Do this:

Table1 = {
		TeamName = "Patient",
		GroupId = 0,
		RankRequirement = 0,
		GamepassId = 0,
		AllAllowed = true
	},

instead of:

{
		TeamName = "Patient",
		GroupId = 0,
		RankRequirement = 0,
		GamepassId = 0,
		AllAllowed = true
	},

Notice the difference?

1 Like

Tried it, didn’t work unfortunately. No errors as usual and nothing printed.

1 Like

It should work if done correctly. Here is a link:

By the way, did it print “child added” when an object has been parented to TeamHolder?

1 Like

Thanks for the link.
No, it did not print “child added”.

1 Like

so now we’ve gotten to this point
i have something to ask you
is an object even being parented to teamholder? did you check from the server?

1 Like

I did, since a frame is being parented to teamholder I checked from my clientside, also since the entire script is a LocalScript under “StarterGui”.
Forgot to answer your question - yes, there is a frame being parented to “teamholder”

1 Like

this issue has continued to make me lose and lose more braincells. i won’t provide full scripts, but i will aid you. here are my guesses:

  • your script does not recognize or see any of the children that have been added at all
  • it could also be due to the big chunk of code below print(“child added”) that yielded the script, you could try temporarily removing it and see what happens

by the way, how are you accessing this player “player123”?

player123 is game.Players.LocalPlayer
thanks for all the tips!

First off, what does the output look like? Considering you’ve obviously done some debugging it’d be helpful to let people know so we can pin point the issue

Nothing got printed, and no errors.

where are you doing the cloning and parenting the frame? is it from a serverscript? localscript?

a localscript, sorry for late response

are you really sure an object is being added to that specific area (TeamHolder) of player??

childadded will always work if the script is able to see the part. for example .childadded functions won’t work on serverscripts if the part being added is ran from a localscript

Yeah, I am.

  • but dont worry, another dev solved it for me. no idea what they did but ill see what they did and post the solution here
1 Like