Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you yield for all the custom descendants of a character?

Asked by 8 years ago

I'm trying to make it so if someone joins my game, it'll remove this hat https://www.roblox.com/item.aspx?seoname=Flintstones-Car&id=439315202

I've stumbled into a problem though, because I haven't found a definitive way to determine if the hat is in the character, because elements such as the hat and clothes load after the character is instanced.

How do I yield for the hats and everything else to be loaded?

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

I just figured a way out after the fact of posting this, but it may not be most efficient way.

pcall(function()
    local Hat = Player.Character:WaitForChild('Flintstones Car')
    if Hat then
        stupidHat:Destroy()
    end
end)
0
No need to pcall, since it will not bug anyway. This is probably one of the only ways, I'll check to see if there are any events/bools in a Player. TheDeadlyPanther 2460 — 8y
Ad

Answer this question