tree1 = workspace.TREES
print("test")
local tree = tree1:FindFirstChild("treething") -- not sure what to do rather than findfirstchild without it breaking
while true do wait(2) local distance1 = 20 local distance3 = 50 local lowpoly = tree.LowPoly for i, v in pairs(workspace:GetChildren()) do if v:FindFirstChild('Humanoid') then if game.Players:FindFirstChild(v.Name) then if (v.HumanoidRootPart.Position - tree.Trunk.Position).Magnitude > distance1 then print("trunk invisible")
tree.Trunk.Transparency = 0 -- wanting this to do this to multiple trunks not just one
--lowpoly.Leaves.Transparency = 1
--lowpoly.Trunk.Transparency = 1
end
if (v.HumanoidRootPart.Position - tree.Trunk.Position).Magnitude > distance3 then
print("trunk visible")
tree.Trunk.Transparency = 1
--lowpoly.Leaves.Transparency = 0.05
--lowpoly.Trunk.Transparency = 0
end
end
end
end
end

2 comments
Hi i have edited the code so that only your trunk is invisible and only your trunk's location is printed, please check the script now!
Hi look at the new edit!