Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Made by Diamond
- --25 Feb 2018
- local Player = game.Players.LocalPlayer;
- local Event = game:GetService("ReplicatedStorage").Events.SwingTool;
- local Args = {};
- local Running = true;
- function CreateTextFrame(ClassName, Parent, Text, AP, Pos, Size, BGT, BGC, TST, TSC)
- local Butt = Instance.new(ClassName or 'TextLabel', Parent or nil);
- Butt.AnchorPoint = AP or Vector2.new(0,0);
- Butt.Position = Pos or UDim2.new(0,0,0,0);
- Butt.Size = Size or UDim2.new(1,0,1,0);
- Butt.BackgroundColor3 = BGC or Color3.new(.15,.15,.15);
- Butt.BorderSizePixel = 0;
- Butt.BackgroundTransparency = BGT or 0;
- Butt.TextScaled = true;
- Butt.TextColor3 = Color3.new(1,1,1);
- Butt.Font = Enum.Font.Cartoon;
- Butt.Text = Text or 'Undefined';
- Butt.TextStrokeTransparency = TST or 1;
- Butt.TextStrokeColor3 = TSC or Color3.new(0,0,0);
- return Butt;
- end
- function Track(M)
- if not M:IsA'Model' then
- return;
- elseif not M.PrimaryPart then
- M.PrimaryPart = M:FindFirstChildOfClass'Part';
- end
- spawn(function()
- wait(.2)
- for i,v in pairs(M:GetDescendants()) do
- if v:IsA'BasePart' then
- v.Anchored = true;
- v.CanCollide = false;
- M.PrimaryPart = M.PrimaryPart == nil and v or M.PrimaryPart;
- end
- end
- Args[#Args+1] = M.PrimaryPart;
- while wait() and Running and M.PrimaryPart and M:IsDescendantOf(workspace) do
- M:SetPrimaryPartCFrame(game.Players.LocalPlayer.Character.PrimaryPart.CFrame);
- end
- for i,v in pairs(Args) do
- if v == M.PrimaryPart then
- table.remove(Args, i);
- end
- end
- end)
- end
- for Index, Child in pairs(workspace:GetChildren()) do
- if Child.Name == "Small Tree" or Child.Name == 'Bush' or Child.Name == 'Lurky Boi' then
- Track(Child);
- end
- end
- local OnAdd = workspace.ChildAdded:Connect(function(Child)
- if Child.Name == "Small Tree" or Child.Name == 'Bush' or Child.Name == 'Lurky Boi' then
- Track(Child);
- end
- end)
- spawn(function()
- local A = CreateTextFrame('TextButton', Instance.new('ScreenGui', Player.PlayerGui), 'Stop', Vector2.new(1,1), UDim2.new(1,0,.7,0), UDim2.new(.1,0,.075,0));
- A.MouseButton1Up:wait(.1);
- Running = false
- Args = {};
- A.Parent:Destroy();
- OnAdd:Disconnect();
- end)
- while wait(.1) and Running do
- Event:FireServer(tick(), Args);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement