So i got another problem with the tree breaking system. I know i’m stupid, but i don’t know why the script breakes.
So basically the script breakes when i add a effect that spawns a log before the destroy happens.
But when i add it, i get a error in output saying “Attempt to index nil with position” on line 21, but when i delete the log part of the script it works completly fine. I don’t know why that happens.
Any help will be appreciated.
Anyways here’s my script
RemoteEvent2.OnServerEvent:Connect(function(player, breakable)
local Log = game:GetService("ServerStorage").DroppedItems.Log:Clone()
Log.Position = breakable.PrimaryPart.Position - Vector3.new(0, 3.5, 0)
Log.Orientation = Vector3.new(math.random(0, 360))
Log.Parent = workspace
breakable:RemoveTag("Breakable")
task.wait()
breakable:Remove()
end)