Advertisement
Cartman366

Untitled

Aug 1st, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.88 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.  
  106. while true do
  107. p.BrickColor = BrickColor.new("Teal")
  108. wait(.5)
  109. p.BrickColor = BrickColor.new("Really red")
  110. end
  111.  
  112. local b = Instance.new("BodyPosition")
  113. b.Parent = p
  114. b.maxForce = Vector3.new(200,0,200)
  115. 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))
  116.  
  117. --[[ Touched Function ]]--
  118.  
  119. function touched(part)
  120. if Gard == true then
  121. h = part.Parent:findFirstChild("Humanoid")
  122. if h ~= nil then
  123. if part.Parent.Name ~= ""..Owner.Name then
  124. h.Health = 0
  125. end
  126. end
  127. end
  128. end
  129. p.Touched:connect(touched)
  130.  
  131. if Creator ~= "Mokuteki" then
  132. m:remove() --[[ please give credit :3 ]]--
  133. end
  134.  
  135. --[[ Commands ]]--
  136.  
  137. function chat(msg)
  138. if string.sub(string.lower(msg), 1, 7) == "attack/" then
  139. c = game.Players:children()
  140. for i = 1, #c do
  141. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 8)) == 1 then
  142. if c[i].Character ~= nil then
  143. AttackP = ""..c[i].Name..""
  144. Attack = true
  145. FollowOwner = false
  146. Gard = true
  147. end
  148. end
  149. end
  150. end
  151. if string.sub(string.lower(msg), 1, 6) == "follow" then
  152. b.maxForce = Vector3.new(200,0,200)
  153. Attack = false
  154. FollowOwner = true
  155. Follow = false
  156. Gard = false
  157. end
  158. if string.sub(string.lower(msg), 1, 5) == "leave" then
  159. m:remove()
  160. script:remove()
  161. end
  162. if string.sub(string.lower(msg), 1, 8) == "commands" then
  163. mss = Instance.new("Message")
  164. mss.Text = "attack/, follow, leave, kick/, follow/"
  165. mss.Parent = Owner.Character
  166. wait(2)
  167. mss.Text = "gard, stay, calm"
  168. wait(1)
  169. mss:remove()
  170. end
  171. if string.sub(string.lower(msg), 1, 5) == "kick/" then
  172. c = game.Players:children()
  173. for i = 1, #c do
  174. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 6)) == 1 then
  175. if c[i].Character ~= nil then
  176. Kick = true
  177. Attack = false
  178. FollowOwner = false
  179. b.maxForce = Vector3.new(math.huge,0,math.huge)
  180. b.position = c[i].Character.Torso.Position
  181. p.Position = c[i].Character.Torso.Position
  182. wait(1)
  183. c[i]:remove()
  184. b.maxForce = Vector3.new(200,0,200)
  185. Attack = false
  186. FollowOwner = true
  187. Kick = false
  188. end
  189. wait(1)
  190. c[i]:remove()
  191. end
  192. end
  193. end
  194. if string.sub(string.lower(msg), 1, 7) == "follow/" then
  195. c = game.Players:children()
  196. for i = 1, #c do
  197. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 8)) == 1 then
  198. if c[i].Character ~= nil then
  199. FollowP = ""..c[i].Name..""
  200. Follow = true
  201. Attack = false
  202. FollowOwner = false
  203. Gard = false
  204. end
  205. end
  206. end
  207. end
  208. if string.sub(string.lower(msg), 1, 4) == "gard" then
  209. Gard = true
  210. Attack = false
  211. Follow = false
  212. end
  213. if string.sub(string.lower(msg), 1, 4) == "stay" then
  214. FollowOwner = false
  215. Attack = false
  216. Follow = false
  217. Kick = false
  218. b.maxForce = Vector3.new(math.huge,0,math.huge)
  219. end
  220. if string.sub(string.lower(msg), 1, 4) == "calm" then
  221. Attack = false
  222. Gard = false
  223. Kick = false
  224. end
  225. end
  226. Owner.Chatted:connect(chat)
  227.  
  228. --[[ Loop ]]--
  229.  
  230.  
  231. while true do
  232. wait()
  233. if Attack == true then
  234. b.maxForce = Vector3.new(math.huge,0,math.huge)
  235. player = game.Players:findFirstChild(AttackP)
  236. b.position = player.Character.Torso.Position
  237. end
  238. if Follow == true then
  239. wait(2)
  240. b.maxForce = Vector3.new(200,0,200)
  241. player = game.Players:findFirstChild(FollowP)
  242. 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))
  243. end
  244. if FollowOwner == true then
  245. wait(2)
  246. b.maxForce = Vector3.new(200,0,200)
  247. 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))
  248. end
  249. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement