Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- MIDAS TOUCH --
- local Player = game.Players.LocalPlayer;
- local Character = Player.Character;
- local CharacterAdded = Player.CharacterAdded:connect(function(NewCharacter)
- Character = NewCharacter;
- end)
- function doPath(Position)
- local Base = CFrame.new(Position) + Vector3.new(10 * math.random(), 10 * math.random(), 10 * math.random())
- local Part = Instance.new("Part", Character);
- Part.Name = "GoldPath";
- Part.BrickColor = BrickColor.new("Cool yellow");
- Part.Material = Enum.Material.SmoothPlastic;
- Part.Reflectance = 0.5;
- Part.Transparency = 1;
- Part.Anchored = true;
- Part.CanCollide = false;
- Part.Locked = true;
- Part.FormFactor = Enum.FormFactor.Custom;
- Part.Size = Vector3.new(3, 0.2, 3);
- Part.CFrame = CFrame.new(Position);
- Instance.new("CylinderMesh", Part);
- spawn(function()
- local Base = Base * CFrame.Angles(math.random(), math.random(), math.random())
- for Alpha = 0, 1, 0.1 do
- wait();
- Part.Transparency = 1 - Alpha;
- Part.CFrame = Base:lerp(CFrame.new(Position), Alpha ^ 2);
- end
- Part.CanCollide = true;
- game.Debris:AddItem(Part, 2.5)
- end)
- end
- while true do
- wait();
- local Head = Character and Character:FindFirstChild("Head");
- local Torso = Character and Character:FindFirstChild("Torso") and Character.Torso;
- if Head then
- Position = Head.Position;
- local Ray = Ray.new(Position, Vector3.new(0, -1e3, 0));
- local Hit, _, Surface = workspace:FindPartOnRay(Ray, Character);
- if Hit and Torso and math.floor(Torso.Velocity.magnitude) > 0 then
- local Surface = Vector3.new(Position.X, Hit.Position.Y + Hit.Size.Y/2, Position.Z);
- if (Surface - Position).magnitude < 5 then
- doPath(Surface);
- end
- end
- local Offset = Vector3.new(-2, -5, -2);
- local P0 = Position + Offset;
- local P1 = Position - Offset;
- local Region = Region3.new(P0, P1);
- local Parts = workspace:FindPartsInRegion3(Region, Character, 100);
- for _, Part in next, Parts do
- local Size = Part.Size;
- if Size.magnitude < (Offset * -2).magnitude then
- Part.BrickColor = BrickColor.new("Cool yellow");
- Part.Material = Enum.Material.SmoothPlastic;
- Part.Reflectance = 0.5;
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement