Advertisement
Cartman366

Untitled

Aug 2nd, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.66 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 = "Mokuteki :D"
  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 = "Block"
  99. p.Size = Vector3.new(2,2,2)
  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, 6) == "color" then
  154. p.BrickColor = BrickColor.new("Teal")
  155. b.maxForce = Vector3.new(200,0,200)
  156. Attack = false
  157. FollowOwner = true
  158. Follow = false
  159. Gard = false
  160. end
  161. if string.sub(string.lower(msg), 1, 6) == "color1" then
  162. p.BrickColor = BrickColor.new("Really black")
  163. b.maxForce = Vector3.new(200,0,200)
  164. Attack = false
  165. FollowOwner = true
  166. Follow = false
  167. Gard = false
  168. end
  169. if string.sub(string.lower(msg), 1, 6) == "color2" then
  170. p.BrickColor = BrickColor.new("Crimson")
  171. b.maxForce = Vector3.new(200,0,200)
  172. Attack = false
  173. FollowOwner = true
  174. Follow = false
  175. Gard = false
  176. end
  177. if string.sub(string.lower(msg), 1, 6) == "color3" then
  178. p.BrickColor = BrickColor.new("Royal purple")
  179. b.maxForce = Vector3.new(200,0,200)
  180. Attack = false
  181. FollowOwner = true
  182. Follow = false
  183. Gard = false
  184. end
  185. if string.sub(string.lower(msg), 1, 5) == "leave" then
  186. m:remove()
  187. script:remove()
  188. end
  189. if string.sub(string.lower(msg), 1, 8) == "commands" then
  190. mss = Instance.new("Message")
  191. mss.Text = "attack/, follow, leave, kick/, follow/, color"
  192. mss.Parent = Owner.Character
  193. wait(2)
  194. mss.Text = "gard, stay, calm"
  195. wait(1)
  196. mss:remove()
  197. end
  198. if string.sub(string.lower(msg), 1, 5) == "kick/" then
  199. c = game.Players:children()
  200. for i = 1, #c do
  201. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 6)) == 1 then
  202. if c[i].Character ~= nil then
  203. Kick = true
  204. Attack = false
  205. FollowOwner = false
  206. b.maxForce = Vector3.new(math.huge,0,math.huge)
  207. b.position = c[i].Character.Torso.Position
  208. p.Position = c[i].Character.Torso.Position
  209. wait(1)
  210. c[i]:remove()
  211. b.maxForce = Vector3.new(200,0,200)
  212. Attack = false
  213. FollowOwner = true
  214. Kick = false
  215. end
  216. wait(1)
  217. c[i]:remove()
  218. end
  219. end
  220. end
  221. if string.sub(string.lower(msg), 1, 7) == "follow/" then
  222. c = game.Players:children()
  223. for i = 1, #c do
  224. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 8)) == 1 then
  225. if c[i].Character ~= nil then
  226. FollowP = ""..c[i].Name..""
  227. Follow = true
  228. Attack = false
  229. FollowOwner = false
  230. Gard = false
  231. end
  232. end
  233. end
  234. end
  235. if string.sub(string.lower(msg), 1, 5) == "guard" then
  236. Gard = true
  237. Attack = false
  238. Follow = false
  239. end
  240. if string.sub(string.lower(msg), 1, 4) == "stay" then
  241. FollowOwner = false
  242. Attack = false
  243. Follow = false
  244. Kick = false
  245. b.maxForce = Vector3.new(math.huge,0,math.huge)
  246. end
  247. if string.sub(string.lower(msg), 1, 4) == "calm" then
  248. Attack = false
  249. Gard = false
  250. Kick = false
  251. end
  252. end
  253. Owner.Chatted:connect(chat)
  254.  
  255. --[[ Loop ]]--
  256.  
  257.  
  258. while true do
  259. wait()
  260. if Attack == true then
  261. b.maxForce = Vector3.new(math.huge,0,math.huge)
  262. player = game.Players:findFirstChild(AttackP)
  263. b.position = player.Character.Torso.Position
  264. end
  265. if Follow == true then
  266. wait(2)
  267. b.maxForce = Vector3.new(200,0,200)
  268. player = game.Players:findFirstChild(FollowP)
  269. 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))
  270. end
  271. if FollowOwner == true then
  272. wait(2)
  273. b.maxForce = Vector3.new(200,0,200)
  274. 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))
  275. end
  276. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement