Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
921
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. --Made by Diamond
  2. --25 Feb 2018
  3.  
  4. local Player = game.Players.LocalPlayer;
  5. local Event = game:GetService("ReplicatedStorage").Events.SwingTool;
  6. local Args = {};
  7. local Running = true;
  8.  
  9. function CreateTextFrame(ClassName, Parent, Text, AP, Pos, Size, BGT, BGC, TST, TSC)
  10. local Butt = Instance.new(ClassName or 'TextLabel', Parent or nil);
  11. Butt.AnchorPoint = AP or Vector2.new(0,0);
  12. Butt.Position = Pos or UDim2.new(0,0,0,0);
  13. Butt.Size = Size or UDim2.new(1,0,1,0);
  14. Butt.BackgroundColor3 = BGC or Color3.new(.15,.15,.15);
  15. Butt.BorderSizePixel = 0;
  16. Butt.BackgroundTransparency = BGT or 0;
  17. Butt.TextScaled = true;
  18. Butt.TextColor3 = Color3.new(1,1,1);
  19. Butt.Font = Enum.Font.Cartoon;
  20. Butt.Text = Text or 'Undefined';
  21. Butt.TextStrokeTransparency = TST or 1;
  22. Butt.TextStrokeColor3 = TSC or Color3.new(0,0,0);
  23. return Butt;
  24. end
  25.  
  26. function Track(M)
  27. if not M:IsA'Model' then
  28. return;
  29. elseif not M.PrimaryPart then
  30. M.PrimaryPart = M:FindFirstChildOfClass'Part';
  31. end
  32.  
  33. spawn(function()
  34. wait(.2)
  35. for i,v in pairs(M:GetDescendants()) do
  36. if v:IsA'BasePart' then
  37. v.Anchored = true;
  38. v.CanCollide = false;
  39. M.PrimaryPart = M.PrimaryPart == nil and v or M.PrimaryPart;
  40. end
  41. end
  42. Args[#Args+1] = M.PrimaryPart;
  43. while wait() and Running and M.PrimaryPart and M:IsDescendantOf(workspace) do
  44. M:SetPrimaryPartCFrame(game.Players.LocalPlayer.Character.PrimaryPart.CFrame);
  45. end
  46. for i,v in pairs(Args) do
  47. if v == M.PrimaryPart then
  48. table.remove(Args, i);
  49. end
  50. end
  51. end)
  52. end
  53.  
  54. for Index, Child in pairs(workspace:GetChildren()) do
  55. if Child.Name == "Small Tree" or Child.Name == 'Bush' or Child.Name == 'Lurky Boi' then
  56. Track(Child);
  57. end
  58. end
  59.  
  60. local OnAdd = workspace.ChildAdded:Connect(function(Child)
  61. if Child.Name == "Small Tree" or Child.Name == 'Bush' or Child.Name == 'Lurky Boi' then
  62. Track(Child);
  63. end
  64. end)
  65.  
  66. spawn(function()
  67. 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));
  68. A.MouseButton1Up:wait(.1);
  69. Running = false
  70. Args = {};
  71. A.Parent:Destroy();
  72. OnAdd:Disconnect();
  73. end)
  74.  
  75. while wait(.1) and Running do
  76. Event:FireServer(tick(), Args);
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement