Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to use the Clone() and Destroy() for a zombie spawner?

I am currently reworking some of the game designs for my SCP087 map. One of the reworks involves using a ontouch event. when a player touches the invisible platform, SCP087-B (a zombie pretty much) spawns in front of you, chases you for a couple of seconds, and then disappears (which I am guessing is done with Destroy() ).

Some information that may be useful (sorry if it isn't)

  • The model is a humanoid that already acts like a zombie (Already has a chase script, a kill script, animation script, and more).
  • The trigger that I'm trying to use is grouped with the model but is not a child of the zombie.

1 answer

To Clone something write:

local CopiedInstance = Instance:Clone()

To Destroy something write:

Insance:Destroy()

Cloning something will clone that instance and all it's children, and destroying something will destroy the specified instance as well as it's children. So if you Clone() the model of the zombie, all it's children (the scripts, humanoid, etc) will also be cloned. And if you Destroy() the model of the zombie, all it's children will also be wiped.

This discussion is preserved as it was. New answers, comments, and votes are closed.