Hello, I am trying to make a game where you have a boss named “AXIS” that you have to fight. the problem is, the trigger that clones AXIS from ServerStorage into workspace is causing it to clone several times instantaneously. I want it to just spawn ONCE. I even used a script, which activates another script inside it to help combat this, to no avail. I even used debounce.
It uses a humanoid touch function in order for it to trigger.
Aw man you cant just give me 2019 code ahhh flashbacks
I would recomend you to keep that organized under one script so you have more control over that becouse what is likely heppens is that this model clones script that basically clones itself.
OORRRRR make script have Archivable property turned off, preventing script from being cloned
I don’t understand. I’m not cloning any scripts. I’m trying to have AXIS clone once. And only once. I did what you told me to do, but it still gives me the same unwanted result.
If it is, then what’s probably happening is AXISTRIGGER is getting cloned and because it gets cloned, the scripts inside it get cloned which starts the whole process over again.
If it is not a descendant of AXIS, then you could implement an if-statement in your touched function that checks if there is a model inside workspace called AXIS already, and if there isn’t, then continue with the code, else just use a return statement and break out of the conditional statement.
Alternatively, if you wanted a proper debounce system, you could add an attribute to the workspace set to a boolean, and toggle it to true once AXIS has spawned, then check that in your touched function.
I had fixed the problem. I had moved a bit of code to another script, which prevented AXISTRIGGER from cloning several times, which in turn prevented several instances of AXIS.