I am trying to make a prop regenning script, and whenever it regens an error saying Attempt to index function with destroy. The error is at line 8.
local regenScript = script
local ServerStorage = game:GetService("ServerStorage")
local Workspace = game:GetService("Workspace")
local regenProps = Workspace:WaitForChild("AllProps")
local save = regenProps:Clone()
local function regenProps()
regenProps:Destroy()
local newSave = save:Clone()
newSave.Parent = Workspace
newSave:MakeJoints()
end
while true do
wait(180)
regenProps()
end

2 comments
Accept if it helped :D
Thanks!