OK for the first script ( localscript ) it is in Starterpack. The I set the time to 2 for testing it out faster and the tree still wont regenerate. This is the main script for tree.

repeat wait() until game.Players.LocalPlayer.Character
local Plr = game.Players.LocalPlayer
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local Mouse = Plr:GetMouse()
local CouldGetWood = true
local TreeCutDown = false
local Treee = game.Workspace.Tree

function ShowProgress(tree)
 if tree == "Tree" then
  for i = 0,1,.01 do
   WC.BG.Bar.Progress.Size = UDim2.new(i,0,1,0)
   wait()
  end
 elseif tree == "HardTree" then
  for i = 0,1,.005 do
   WC.BG.Bar.Progress.Size = UDim2.new(i,0,1,0)
   wait()
  end
 end
end

Mouse.Button1Down:connect(function()
 if Mouse.Target ~= nil and Mouse.Target.Parent.Name == "Tree" and CouldGetWood == true then
  local Wood = Mouse.Target
  if (Wood.Position - Char.UpperTorso.Position).magnitude < 10 then
   CouldGetWood = false
   WC = Plr.PlayerGui.WoodChopper
   WC.BG.Visible = true
   Char.Humanoid.WalkSpeed = 0
   ShowProgress ("Tree")
   Char.Humanoid.WalkSpeed = 16
   for i,v in pairs(Wood.Parent.Leaves:GetChildren())do
    if v:IsA("Part") then
     v.Anchored = false
    end
   end
   Wood:Destroy()
   WC.BG.Visible = false
   TreeCutDown = true
   CouldGetWood = true
  end
 end

 if Mouse.Target ~= nil and Mouse.Target.Parent.Name == "HardTree" and CouldGetWood == true then
  local Wood = Mouse.Target
  if (Wood.Position - Char.Torso.Position).magnitude < 10 then
   CouldGetWood= false
   WC = Plr.PlayerGui.WoodChopper
   WC.BG.Visible = true
   Char.Humanoid.WalkSpeed = 0
   ShowProgress ("HardTree")
   Char.Humanoid.WalkSpeed = 16
   for i,v in pairs(Wood.Parent.Leaves:GetChildren())do
    if v:IsA("Part") then
     v.Anchored = false
    end
   end
   Wood:Destroy()
   TreeCutDown = true
   WC.BG.Visible = false
   CouldGetWood = true
  end
 end
end)

while wait(2) and TreeCutDown == true do --Runs every 60 seconds and checks if the trees were cut down
	game.ReplicatedStorage:WaitForChild("TreeSpawner")                                                                 
    game.ReplicatedStorage.TreeSpawner:FireServer(Treee, "Name", Vector3.new(505, 30.546, 90.298), game.Workspace.Tree)--Change the game.Workspace.TreesModel to whatever you want, just make sure its in the workspace
    TreeCutDown = false
end

Now for the second script that is also in Starter pack but it is a regular script ( not localscript ) I'm getting this error for that script, 14:44:57.830 - TreeSpawner is not a valid member of ReplicatedStorage, I dont know if this error affects the first script of the respawning. Here is the second script.

game.ReplicatedStorage:WaitForChild("TreeSpawner")
game.ReplicatedStorage.TreeSpawner.OnServerEvent:Connect(function(Player, Object,name, Position, Place)

    local Tree = Object:Clone() --Clones the tree
    Tree.Name = name
    Tree.Parent  = Place 
    Tree.Position = Vector3.new(Position)
end)

and there is a remote event in replicated storage named "TreeSpawner" so why wont it respawn?

4 comments

0

Maybe try "game.ReplicatedStorage:WaitForChild("TreeSpawner")" it could be a batter of the instance not loading in before you try to use it.

0

where would I insert that in my script(s)?

0

line 68 and line 1

0

So I edited the script and edited my post so you can see where I put it, and it didn't work