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

How do I make it so that weapons in the workspace respawn at certain intervals?

Asked by 10 years ago

I want to make it so that weapons that are in the workspace respawn, that way I don't have to bother messing around with rounds and complicated things like that. I think the script would have to be put into the weapons themselves, but I don't know. Could someone please help me with this?

1 answer

Log in to vote
1
Answered by 10 years ago

Off the top of my head, idk if it works, but it should:

local gear = {}
for i,v in pairs (workspace:GetChildren()) do
    if v:IsA("Tool") then
        gear[i] = v:clone()
        v.AncestryChanged:connect(function()
            Delay(30, function()  -- 30 = time until respawn
                gear[i]:clone().Parent = workspace
            end)
        end)
    end
end

If it doesn't, I know I made a free model for this at some point anyway :P

0
Would this be a localscript? Or just a normal one? Tallestmidget7 95 — 10y
0
A normal script. You can put it in ServerScriptService if you'd like to keep things going smoothly. DiamondBladee 135 — 10y
Ad

Answer this question