The Script:
while wait(1) do
local DistanceFromPart = (script.Parent.Position - plr.Character:WaitForChild(“HumanoidRootPart”).Position).magnitude
if 15 > DistanceFromPart then
if not script.Parent:FindFirstChild("TreeHealth") then
TreeHealthGui.Parent = script.Parent
end
elseif 15 < DistanceFromPart then
if script.Parent:FindFirstChild("TreeHealth") then
script.Parent.TreeHealth:Destroy()
end
end
end
this error pops up when i move away from the item and come back
the error: The Parent property of TreeHealth is locked, current parent: NULL, new parent Tree