I have an easter egg with a text label that will only show up when the player is close enough to the Part. I've tried getting the distance, but either I'm using the wrong thing entirely or there's a minor error in there. But mostly the thing I can't seem to figure out is how to get the position of the player, as it says that HumanoidRootPart is not a valid member of player.
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg == "message" and player.HumanoidRootPart.Position - workspace.TreeSecret.Trunk <= 10 then
script.Parent.SurfaceGui.TextLabel.Visible = true
wait(0.5)
script.Parent.SurfaceGui.TextLabel.Visible = false
end
end)
end)
Thanks

1 comment
local Distance = (Part.Position - Compare.Position).Magnitude