Advertisement
ValiantBoi

mud

Aug 24th, 2019
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. --Script
  2. local mud = Instance.new("Part")
  3. mud.Name = "Mud"
  4. mud.Material = Enum.Material.Grass
  5. mud.BrickColor = BrickColor.new("Pine Cone")
  6. mud.Anchored = true
  7. mud.Size = Vector3.new(20, 10, 2)
  8. mud.CFrame = CFrame.new(0, 5, -20)
  9. mud.Parent = script
  10. local click = Instance.new("ClickDetector")
  11. click.Name = "Collect"
  12. click.Parent = mud
  13. local function Tag(click, Text, Type)
  14. click.MouseHoverEnter:Connect(function(plr)
  15. local gui = Instance.new("ScreenGui")
  16. gui.Name = "MudInfo"
  17. gui.Parent = plr.PlayerGui
  18. local text = Instance.new("TextLabel")
  19. text.Name = "Mud"
  20. text.BorderSizePixel = 0
  21. text.BackgroundColor3 = Color3.new(1, 1, 1)
  22. text.Size = UDim2.new(0, 200, 0, 50)
  23. text.Position = UDim2.new(1, -210, 1, -60)
  24. text.ZIndex = 2
  25. text.Font = Enum.Font.SourceSansSemibold
  26. if Type == "Normal" then
  27. text.Text = Text
  28. end
  29. if Type == "Click" then
  30. if click.Parent:FindFirstChild("MudJoint") and click.Parent.MudJoint.Part0.Parent.Name == plr.Name then
  31. text.Text = "Drop"
  32. else
  33. text.Text = Text
  34. end
  35. end
  36. text.TextColor3 = Color3.new(1, 1, 1)
  37. text.TextStrokeTransparency = 0
  38. text.TextScaled = true
  39. text.Parent = gui
  40. local shade = Instance.new("Frame")
  41. shade.Name = "Shade"
  42. shade.BorderSizePixel = 0
  43. shade.BackgroundColor3 = Color3.new(0, 0, 0)
  44. shade.Size = UDim2.new(0, 200, 0, 50)
  45. shade.Position = UDim2.new(1, -204, 1, -54)
  46. shade.Parent = gui
  47. end)
  48. click.MouseHoverLeave:Connect(function(plr)
  49. if plr.PlayerGui:FindFirstChild("MudInfo") then
  50. plr.PlayerGui.MudInfo:Destroy()
  51. end
  52. end)
  53. end
  54. Tag(click, "Mud", "Normal")
  55. click.MouseClick:Connect(function(plr)
  56. if plr.Character and plr.Character:FindFirstChild("Torso") and not plr.Character.Torso:FindFirstChild("TempRS") then
  57. local char = plr.Character
  58. local tors = char.Torso
  59. local ra = char["Right Arm"]
  60. local la = char["Left Arm"]
  61. local RS = Instance.new("Weld")
  62. RS.Name = "TempRS"
  63. RS.Part0 = tors
  64. RS.Part1 = ra
  65. RS.C0 = CFrame.new(0.8, 0.5, -0.5, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.Angles(0, 0.5, 1)
  66. RS.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  67. RS.Parent = tors
  68. local LS = Instance.new("Weld")
  69. LS.Name = "TempLS"
  70. LS.Part0 = tors
  71. LS.Part1 = la
  72. LS.C0 = CFrame.new(-0.8, 0.5, -0.5, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.Angles(0, -0.5, -1)
  73. LS.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  74. LS.Parent = tors
  75. local mudpiece = Instance.new("Part")
  76. mudpiece.Name = "Mud"
  77. mudpiece.Material = Enum.Material.Grass
  78. mudpiece.BrickColor = BrickColor.new("Pine Cone")
  79. mudpiece.Size = Vector3.new(3, 3, 3)
  80. mudpiece.Shape = Enum.PartType.Ball
  81. mudpiece.Parent = script
  82. local weld = Instance.new("Weld")
  83. weld.Name = "MudJoint"
  84. weld.Part0 = tors
  85. weld.Part1 = mudpiece
  86. weld.C0 = CFrame.new(0, -0.5, -3)
  87. weld.Parent = mudpiece
  88. local click = Instance.new("ClickDetector")
  89. click.Name = "Tag"
  90. click.Parent = mudpiece
  91. Tag(click, "Mud", "Click")
  92. click.MouseClick:Connect(function(player)
  93. if mudpiece:FindFirstChildOfClass("Weld") then
  94. if player == plr then
  95. weld:Destroy()
  96. RS:Destroy()
  97. LS:Destroy()
  98. end
  99. else
  100. char = player.Character
  101. tors = char.Torso
  102. ra = char["Right Arm"]
  103. la = char["Left Arm"]
  104. RS = Instance.new("Weld")
  105. RS.Name = "TempRS"
  106. RS.Part0 = tors
  107. RS.Part1 = ra
  108. RS.C0 = CFrame.new(0.8, 0.5, -0.5, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.Angles(0, 0.5, 1)
  109. RS.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  110. RS.Parent = tors
  111. LS = Instance.new("Weld")
  112. LS.Name = "TempLS"
  113. LS.Part0 = tors
  114. LS.Part1 = la
  115. LS.C0 = CFrame.new(-0.8, 0.5, -0.5, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.Angles(0, -0.5, -1)
  116. LS.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  117. LS.Parent = tors
  118. weld = Instance.new("Weld")
  119. weld.Name = "MudJoint"
  120. weld.Part0 = tors
  121. weld.Part1 = mudpiece
  122. weld.C0 = CFrame.new(0, -0.5, -3)
  123. weld.Parent = mudpiece
  124. plr = player
  125. end
  126. end)
  127. end
  128. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement