--[[ Options ]]-- local Egg_Name = 'Easter_Egg'; local Tool_Name = 'Egg Finder'; local Egg_Radius = 20; --[[---------]]-- local Player = Game:GetService('Players').LocalPlayer; local stepped = Game:GetService('RunService').Stepped; local Backpack = Player:WaitForChild('Backpack'); local Character = Player.Character; local debounce = false; function mag(p0, p1) return math.abs((p0.Position - p1.Position).magnitude); end; function getNearestEgg(_part) local part, lmag = nil, math.huge; for i, v in next, Workspace:GetChildren() do if v:IsA('BasePart') then local xmag = mag(v, _part); if v.Name == Egg_Name and xmag <= lmag then part, lmag = v, xmag; end; end; end; return part; end; pcall(Game.Destroy, Backpack:FindFirstChild(Tool_Name)); local tool = Instance.new('Tool', Backpack); tool.Name = Tool_Name; script.Parent = tool; local handle = Instance.new('Part', tool); handle.Name = 'Handle'; handle.FormFactor = 'Custom'; handle.Size = Vector3.new(0, 0, 0); handle.Transparency = 1; coroutine.wrap(function() repeat if tool.Parent ~= Backpack and tool.Parent ~= Character then pcall(Game.Destroy, Backpack:FindFirstChild(Tool_Name)); end; until stepped:wait() == nil end)(); tool.Equipped:connect(function(mouse) if debounce == true then return; end; debounce = true; Workspace.CurrentCamera:ClearAllChildren(); local egg, EXIT = getNearestEgg(handle), 0; local dir = Instance.new('Part', Workspace.CurrentCamera); dir.Anchored = true; dir.Size = Vector3.new(math.pi, 1, 4); dir.BrickColor = BrickColor.new('New Yeller'); dir.Transparency = 1; dir.Name = 'LOL'; dir.CanCollide = false; local decal = Instance.new('Decal', dir); decal.Texture = 'http://www.roblox.com/asset/?id=21311470'; decal.Face = 'Top'; repeat if not debounce then EXIT = 1; break; end; dir.CFrame = CFrame.new(handle.Position, egg.Position) * CFrame.Angles(0, math.rad(180), 0) * CFrame.new(0, -2, 3); if mag(egg, handle) <= Egg_Radius then break; end; until stepped:wait() == nil; dir:Destroy(); if EXIT == 0 then pcall(Game.Destroy, tool); end; local h = Instance.new('Hint', Workspace.CurrentCamera); h.Text = 'You are not currently within 20 studs of an egg!'; delay(1, function() h:Destroy(); end); debounce = false; end); tool.Unequipped:connect(function() debounce = false; end);