Descendant's name not printing, instead it prints its class name

I don’t necessarily post topics in studio, but this random issue has been bugging me.
So I was trying to make an anti-exploit script, and I have a table full of virus names, I’m using game.Workspace.DescendantAdded to check the workspace for suspicious objects, however it is not printing the actual name, instead the class name. Here is the code:

game.Workspace.DescendantAdded:Connect(function(Descendant)
	print(Descendant.Name)
end)

What it’s supposed to print:

Vaccine

What it actually printed:

Script

Yes, I playtested and made sure that the Script’s name is “Vaccine”. I used a separate testing script that waits exactly 20 seconds and then instances a script named “Vaccine” (as a test) to workspace. I don’t think it’s necessary to send the code here though, because it’s literally just creating an instance and naming it.

Perhaps you parented the instance before naming it? Immediate signal behaviour can trigger the event before the new name is applied. Not supposed to happen under Deferred behaviour, however.

1 Like

hmm… good point. will test this out tomorrow

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.