Basically I am making an Axe and Tree system, I want it so you can cut down the tree when you hit a proximity prompt, right now I am getting this error message, if you need the entire program I can provide it if needed! This script is a local script within the Axe Tool in Starterpack.
for index, v in pairs() do
if v:IsA("BasePart") then
v.Anchored = false
v.Transparency = 0.2
task.wait(3)
v.Transparency = 1
v.CanCollide = false
end
end
print("Health is 0")
task.wait(30)
Health = 5
for _, v in pairs (game.workspace.Tree:GetDescendants())do
if v.Name == 'Part' then
v.Anchored = true
v.Transparency = 0
v.CanCollide = true
end
end