I really don’t know I think that function runs as many times as the person presses the exit button or some other weird thing, but I’ve never seen that before.
local Players = game:GetService('Players')
Players.PlayerRemoving:Connect(function(player)
local children = workspace.Dracolyx:GetChildren()
for _,v in pairs(children) do
print(v)
end
end)
Well if you don’t have any other scripts than just that, then the problem would be on Roblox’s side, since I tested in studio and it as well worked normally for me.
But if you have more scripts I suggest you analyze them to figure out if something may be creating duplicates of the parts when the player leaves, or maybe just duplicates in general something could be cloning multiples in one of your scripts. Other than that, the issue is a mystery to me.
Ask yourself these questions:
Have you disabled anything default that roblox offers?
Could it be a bug causing this to happen?
What did I do before this happened?
Why do you need duplicates? Is this just something you were experimenting?
Thanks, but not this case, once I have a print at the beginning of the function and it prints only 1 time, but GetChildren is printing 3 times each part.
And as I said, it’ s happening only in ServerScript -> Players.PlayerRemoving:Connect(function(player), not in LocalScript.
It seems a Studio bug, but as I see, it’s happening only with me…
it’s hard to help someone when they are only sharing pieces of their code, for all i know they could have connections stacking upon each other, which causes his problem
Let’s leave it at that for now.
I appreciate everyone’s attention.
I’m sure that at some moment this mystery will be cleared up.
So I will put the solution here.
Thank you all.
And if it doesn’t get cleared up? Wouldn’t sharing the code you possess benefit yourself to figuring out the issue? We can work together to fix whatever is causing your character’s parts to triplicate.
In addition to GetChildren listing 3 times each item (only if using GetChildren inside ServerScript, because in LocalScript it works ok), now I realized that even if I remove an object with Destroy(), the object correctly disappear from workspace but still will appear in GetChildren of ServerScript, that is, it is as if there is a different or outdated GetChildren within ServerScript.
The worst thing is that I tried to create a new project and do some simulations but I was not able to get the same problem, it only occurs in my current project.
Does anyone have any idea what is creating this nightmare?
Showing the whole code would help, because this would only result in printing the table’s memory address. Maybe it’s your code logic that’s causing it to print the children 3 times.