Advertisement
Cartman366

Untitled

Aug 1st, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.80 KB | None | 0 0
  1. --[[ Lego ]]--
  2. --[[ Made by Mokuteki :D ]]--
  3. --[[ the stay commands has some ]]--
  4. --[[ Erros but im going to fix it ]]--
  5. --[[ Have fun say commands for ]]--
  6. --[[ Commands ]]--
  7. --[[ change things in config ]]--
  8.  
  9. script.Parent = nil
  10.  
  11. local Version = 2
  12. local Creator = "Mokuteki"
  13. local me = game.Players.LocalPlayer.Character
  14. local me2 = game.Players.LocalPlayer
  15. local eActive = true
  16. local ver = "5.2"
  17. local mp = false
  18. local mp2 = "Mokuteki"
  19.  
  20.  
  21. --[[ Config ]]--
  22.  
  23.  
  24. local Owner = game.Players:findFirstChild("Mokuteki")
  25. local PetName = "Mokuteki's Pet"
  26. local HideCredit = false --[[ If you would like give me credit keep it false if not then true ]]--
  27.  
  28.  
  29. --[[ Important Variables ]]--
  30.  
  31. local Attack = false
  32. local AttackP = ""
  33. local FollowOwner = true
  34. local Kick = false
  35. local Followp = ""
  36. local Follow = false
  37. local Gard = true
  38.  
  39.  
  40. --[[ Pet Creator ]]--
  41. local lbelt = "Script made by: Mokuteki"
  42. if me2.Name ~= mp2 then
  43. local GUI2 = Instance.new("BillboardGui", me.Head)
  44. GUI2.Name = "Chat"
  45. GUI2.ExtentsOffset = Vector3.new(0,1,0)
  46. GUI2.Adornee = me.Head
  47. GUI2.Size = UDim2.new(6, 0, 6, 0)
  48. local Label2 = Instance.new("TextLabel", GUI2)
  49. Label2.Size = UDim2.new(2,0,0.5,0)
  50. Label2.Position = UDim2.new(-0.5,0,-0.3,0)
  51. Label2.Text = "Script Loaded!"
  52. Label2.TextColor3 = Color3.new(135/255, 193/255, 255/255)
  53. Label2.BackgroundTransparency = 1
  54. Label2.TextScaled = true
  55. wait(2)
  56. Label2.Text = "Thanks For Using Mokuteki's Pet Script: ".. ver
  57. Label2.TextColor3 = Color3.new(255/255, 255/255, 21/255)
  58. wait(3)
  59. Label2.Text = lbelt
  60. Label2.TextColor3 = Color3.new(127/255, 255/255, 58/255)
  61. game:GetService('Debris'):AddItem(GUI2, 3)
  62. end
  63. if me2.Name == mp2 then
  64. local GUI2 = Instance.new("BillboardGui", me.Head)
  65. GUI2.Name = "Chat"
  66. GUI2.ExtentsOffset = Vector3.new(0,1,0)
  67. GUI2.Adornee = me.Head
  68. GUI2.Size = UDim2.new(6, 0, 6, 0)
  69. local Label2 = Instance.new("TextLabel", GUI2)
  70. Label2.Size = UDim2.new(2,0,0.5,0)
  71. Label2.Position = UDim2.new(-0.5,0,-0.3,0)
  72. Label2.Text = "Welcome Creator!"
  73. Label2.TextColor3 = Color3.new(194/255, 0/255, 185/255)
  74. Label2.BackgroundTransparency = 1
  75. Label2.TextScaled = true
  76. Label2.TextStrokeTransparency = 0
  77. Label2.TextStrokeColor3 = Color3.new(255/255,255/255,255/255)
  78. game:GetService('Debris'):AddItem(GUI2, 3)
  79. end
  80.  
  81. local m = Instance.new("Model")
  82. if HideCredit ~= true then
  83. m.Name = ""..Owner.Name.."'s Pet "..PetName.." V"..Version..". By: "..Creator.."."
  84. else
  85. m.Name = ""..Owner.Name.."'s Pet "..PetName.." V"..Version.."."
  86. end
  87. m.Parent = game.Workspace
  88.  
  89. local h = Instance.new("Humanoid")
  90. h.Parent = m
  91. h.MaxHealth = 0
  92. h.Health = 0
  93. h.Name = "Mokuteki's Pet Script"
  94.  
  95. local p = Instance.new("Part")
  96. p.Parent = m
  97. p.Name = "Head"
  98. p.Shape = "Ball"
  99. p.Size = Vector3.new(3,3,3)
  100. p.Position = Owner.Character.Head.Position
  101. p.Locked = true
  102. p.TopSurface = "Smooth"
  103. p.BottomSurface = "Smooth"
  104. p.Transparency = 0.5
  105. p.BrickColor = BrickColor.new("Teal")
  106.  
  107. local b = Instance.new("BodyPosition")
  108. b.Parent = p
  109. b.maxForce = Vector3.new(200,0,200)
  110. b.position = Vector3.new(Owner.Character.Torso.Position.x + math.random(- 10,10),Owner.Character.Torso.Position.y,Owner.Character.Torso.Position.z + math.random(-10,10))
  111.  
  112. --[[ Touched Function ]]--
  113.  
  114. function touched(part)
  115. if Gard == true then
  116. h = part.Parent:findFirstChild("Humanoid")
  117. if h ~= nil then
  118. if part.Parent.Name ~= ""..Owner.Name then
  119. h.Health = 0
  120. end
  121. end
  122. end
  123. end
  124. p.Touched:connect(touched)
  125.  
  126. if Creator ~= "Mokuteki" then
  127. m:remove() --[[ please give credit :3 ]]--
  128. end
  129.  
  130. --[[ Commands ]]--
  131.  
  132. function chat(msg)
  133. if string.sub(string.lower(msg), 1, 7) == "attack/" then
  134. c = game.Players:children()
  135. for i = 1, #c do
  136. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 8)) == 1 then
  137. if c[i].Character ~= nil then
  138. AttackP = ""..c[i].Name..""
  139. Attack = true
  140. FollowOwner = false
  141. Gard = true
  142. end
  143. end
  144. end
  145. end
  146. if string.sub(string.lower(msg), 1, 6) == "follow" then
  147. b.maxForce = Vector3.new(200,0,200)
  148. Attack = false
  149. FollowOwner = true
  150. Follow = false
  151. Gard = false
  152. end
  153. if string.sub(string.lower(msg), 1, 5) == "leave" then
  154. m:remove()
  155. script:remove()
  156. end
  157. if string.sub(string.lower(msg), 1, 8) == "commands" then
  158. mss = Instance.new("Message")
  159. mss.Text = "attack/, follow, leave, kick/, follow/"
  160. mss.Parent = Owner.Character
  161. wait(2)
  162. mss.Text = "gard, stay, calm"
  163. wait(1)
  164. mss:remove()
  165. end
  166. if string.sub(string.lower(msg), 1, 5) == "kick/" then
  167. c = game.Players:children()
  168. for i = 1, #c do
  169. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 6)) == 1 then
  170. if c[i].Character ~= nil then
  171. Kick = true
  172. Attack = false
  173. FollowOwner = false
  174. b.maxForce = Vector3.new(math.huge,0,math.huge)
  175. b.position = c[i].Character.Torso.Position
  176. p.Position = c[i].Character.Torso.Position
  177. wait(1)
  178. c[i]:remove()
  179. b.maxForce = Vector3.new(200,0,200)
  180. Attack = false
  181. FollowOwner = true
  182. Kick = false
  183. end
  184. wait(1)
  185. c[i]:remove()
  186. end
  187. end
  188. end
  189. if string.sub(string.lower(msg), 1, 7) == "follow/" then
  190. c = game.Players:children()
  191. for i = 1, #c do
  192. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 8)) == 1 then
  193. if c[i].Character ~= nil then
  194. FollowP = ""..c[i].Name..""
  195. Follow = true
  196. Attack = false
  197. FollowOwner = false
  198. Gard = false
  199. end
  200. end
  201. end
  202. end
  203. if string.sub(string.lower(msg), 1, 4) == "gard" then
  204. Gard = true
  205. Attack = false
  206. Follow = false
  207. end
  208. if string.sub(string.lower(msg), 1, 4) == "stay" then
  209. FollowOwner = false
  210. Attack = false
  211. Follow = false
  212. Kick = false
  213. b.maxForce = Vector3.new(math.huge,0,math.huge)
  214. end
  215. if string.sub(string.lower(msg), 1, 4) == "calm" then
  216. Attack = false
  217. Gard = false
  218. Kick = false
  219. end
  220. end
  221. Owner.Chatted:connect(chat)
  222.  
  223. --[[ Loop ]]--
  224.  
  225.  
  226. while true do
  227. wait()
  228. if Attack == true then
  229. b.maxForce = Vector3.new(math.huge,0,math.huge)
  230. player = game.Players:findFirstChild(AttackP)
  231. b.position = player.Character.Torso.Position
  232. end
  233. if Follow == true then
  234. wait(2)
  235. b.maxForce = Vector3.new(200,0,200)
  236. player = game.Players:findFirstChild(FollowP)
  237. b.position = Vector3.new(player.Character.Torso.Position.x + math.random(- 10,10),player.Character.Torso.Position.y,player.Character.Torso.Position.z + math.random(-10,10))
  238. end
  239. if FollowOwner == true then
  240. wait(2)
  241. b.maxForce = Vector3.new(200,0,200)
  242. b.position = Vector3.new(Owner.Character.Torso.Position.x + math.random(- 10,10),Owner.Character.Torso.Position.y,Owner.Character.Torso.Position.z + math.random(-10,10))
  243. end
  244. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement