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

How would I turn the added child into a variable, with .ChildAdded?

Asked by
A_Mp5 222 Moderation Voter
3 years ago

I need help making a script, that when a child/descendant is added to workspace, it goes in a function, and the child is a variable.

That's it.

1 answer

Log in to vote
1
Answered by
Wayyllon 170
3 years ago

This should be what you're looking for.

function DoWhatever(Child)
    if Child....... then

    end
end
game.Workspace.ChildAdded:Connect(function(Child)
    DoWhatever(Child)
end)

Helpful Links:

https://developer.roblox.com/en-us/api-reference/event/Instance/ChildAdded

Ad

Answer this question