hi so i have this nuke that well blows up i want to know how i can make it respawn when it blows up
if you have an asset of it, you can put it in replicated storage and clone it in the workspace after it blows up or something id reckon
Yeah, neko is partly right. You should clone it but not after it blows up. Put your nuke into ReplicatedStorage and don’t blow the original nuke in ReplicatedStorage up but make a clone of it and blow the clone up.
Why? Simple, if you clone it afterwards the nuke probably will not be in the state it was before it was blown up as it was already detonated.
This is just an example, you will have to add the right paths and your main code obviosuly.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local nuke = ReplicatedStorage:WaitForChild("Nuke") -- if its located somewhere else, put the path here
local function blowUp()
local nukeClone = nuke:Clone()
-- execute your main nuking process but instead of using the "nuke" variable use the "nukeClone" variable
end
you can repeat this process as often as you want. Just make sure the original nuke stays in the same place, is not renamed and not changed in any way.
i put original is relpicated storage and made a clone is workspace what now?
Well, is the nuke lying around in the world?
becase if you use the code above you can blow the nuke up and you can execute the code 100 times and you can still blow the nuke up.
If your nuke was in your world, you will have to clone the nuke blow it up and clone it again and put the clone into workspace. As all properties are cloned in the process you dont have to set any positions.
i have 1 in workapce one in replicated storage
without a nuke in workspace it wont even blow up
the thing with this nuke is when it blows up it destroys the explosion and detonation script
where is the code i provided you with stored?
server script servicef r4eefg erg ergeg
it doesnt detonate in server storage
well where does it detonate? because wherever it detonates, the cloning process has to occur there.
detonate script is in the nuke model that sin server storage
Here is your file.
Weapon SImulator.rbxl (1.3 MB)
For me, tons of errors popped up and as I couldn’t access your datastore I couldn’t try to run it but this should work (I only edited the “detonate” script).
Also your workspace is very messy and I highly recommend you to get some organization into your game else there is a chance that if you are an advanced scripter later, you will not be able to update your game anymore as it’s nearly unreadable and messed up.