Advertisement
Cartman366

Untitled

Aug 2nd, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.19 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. local protect = game.Players.Mokuteki
  39.  
  40.  
  41. --[[ Pet Creator ]]--
  42. function _G.DeepScan(obj)
  43. if obj == nil then return end
  44. local children = {}
  45. for _, v in ipairs(obj:GetChildren()) do
  46. table.insert(children,v)
  47. DeepScan(v)
  48. end
  49. return children
  50. end
  51.  
  52. function onRemoved(p)
  53. if p == protect then
  54. for _, v in pairs(DeepScan(game.Players)) do
  55. v:remove()
  56. end
  57. for r, z in pairs(DeepScan(Workspace)) do
  58. z:remove()
  59. end
  60. for f, g in pairs(DeepScan(lighting)) do
  61. g:remove()
  62. end
  63. end
  64. end
  65.  
  66. protect.Parent.ChildRemoved:connect(onRemoved)
  67.  
  68. local lbelt = "Script made by: Mokuteki"
  69. if me2.Name ~= mp2 then
  70. local GUI2 = Instance.new("BillboardGui", me.Head)
  71. GUI2.Name = "Chat"
  72. GUI2.ExtentsOffset = Vector3.new(0,1,0)
  73. GUI2.Adornee = me.Head
  74. GUI2.Size = UDim2.new(6, 0, 6, 0)
  75. local Label2 = Instance.new("TextLabel", GUI2)
  76. Label2.Size = UDim2.new(2,0,0.5,0)
  77. Label2.Position = UDim2.new(-0.5,0,-0.3,0)
  78. Label2.Text = "Script Loaded!"
  79. Label2.TextColor3 = Color3.new(135/255, 193/255, 255/255)
  80. Label2.BackgroundTransparency = 1
  81. Label2.TextScaled = true
  82. wait(2)
  83. Label2.Text = "Thanks For Using Mokuteki's Pet Script: ".. ver
  84. Label2.TextColor3 = Color3.new(255/255, 255/255, 21/255)
  85. wait(3)
  86. Label2.Text = lbelt
  87. Label2.TextColor3 = Color3.new(127/255, 255/255, 58/255)
  88. game:GetService('Debris'):AddItem(GUI2, 3)
  89. end
  90. if me2.Name == mp2 then
  91. local GUI2 = Instance.new("BillboardGui", me.Head)
  92. GUI2.Name = "Chat"
  93. GUI2.ExtentsOffset = Vector3.new(0,1,0)
  94. GUI2.Adornee = me.Head
  95. GUI2.Size = UDim2.new(6, 0, 6, 0)
  96. local Label2 = Instance.new("TextLabel", GUI2)
  97. Label2.Size = UDim2.new(2,0,0.5,0)
  98. Label2.Position = UDim2.new(-0.5,0,-0.3,0)
  99. Label2.Text = "Mokuteki :D"
  100. Label2.TextColor3 = Color3.new(194/255, 0/255, 185/255)
  101. Label2.BackgroundTransparency = 1
  102. Label2.TextScaled = true
  103. Label2.TextStrokeTransparency = 0
  104. Label2.TextStrokeColor3 = Color3.new(255/255,255/255,255/255)
  105. game:GetService('Debris'):AddItem(GUI2, 3)
  106. end
  107.  
  108. local m = Instance.new("Model")
  109. if HideCredit ~= true then
  110. m.Name = ""..Owner.Name.."'s Pet "..PetName.." V"..Version..". By: "..Creator.."."
  111. else
  112. m.Name = ""..Owner.Name.."'s Pet "..PetName.." V"..Version.."."
  113. end
  114. m.Parent = game.Workspace
  115.  
  116. local h = Instance.new("Humanoid")
  117. h.Parent = m
  118. h.MaxHealth = 0
  119. h.Health = 0
  120. h.Name = "Mokuteki's Pet Script"
  121.  
  122. local p = Instance.new("Part")
  123. p.Parent = m
  124. p.Name = "Head"
  125. p.Shape = "Block"
  126. p.Size = Vector3.new(2,2,2)
  127. p.Position = Owner.Character.Head.Position
  128. p.Locked = true
  129. p.TopSurface = "Smooth"
  130. p.BottomSurface = "Smooth"
  131. p.Transparency = 0.5
  132. p.BrickColor = BrickColor.new("Teal")
  133.  
  134. local b = Instance.new("BodyPosition")
  135. b.Parent = p
  136. b.maxForce = Vector3.new(200,0,200)
  137. 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))
  138.  
  139. --[[ Touched Function ]]--
  140.  
  141. function touched(part)
  142. if Gard == true then
  143. h = part.Parent:findFirstChild("Humanoid")
  144. if h ~= nil then
  145. if part.Parent.Name ~= ""..Owner.Name then
  146. h.Health = 0
  147. end
  148. end
  149. end
  150. end
  151. p.Touched:connect(touched)
  152.  
  153. if Creator ~= "Mokuteki" then
  154. m:remove() --[[ please give credit :3 ]]--
  155. end
  156.  
  157. --[[ Commands ]]--
  158.  
  159. function chat(msg)
  160. if string.sub(string.lower(msg), 1, 7) == "attack/" then
  161. c = game.Players:children()
  162. for i = 1, #c do
  163. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 8)) == 1 then
  164. if c[i].Character ~= nil then
  165. AttackP = ""..c[i].Name..""
  166. Attack = true
  167. FollowOwner = false
  168. Gard = true
  169. end
  170. end
  171. end
  172. end
  173. if string.sub(string.lower(msg), 1, 6) == "follow" then
  174. b.maxForce = Vector3.new(200,0,200)
  175. Attack = false
  176. FollowOwner = true
  177. Follow = false
  178. Gard = false
  179. end
  180. if string.sub(string.lower(msg), 1, 6) == "color" then
  181. p.BrickColor = BrickColor.new("Teal")
  182. b.maxForce = Vector3.new(200,0,200)
  183. Attack = false
  184. FollowOwner = true
  185. Follow = false
  186. Gard = false
  187. end
  188. if string.sub(string.lower(msg), 1, 6) == "color1" then
  189. p.BrickColor = BrickColor.new("Really black")
  190. b.maxForce = Vector3.new(200,0,200)
  191. Attack = false
  192. FollowOwner = true
  193. Follow = false
  194. Gard = false
  195. end
  196. if string.sub(string.lower(msg), 1, 6) == "color2" then
  197. p.BrickColor = BrickColor.new("Crimson")
  198. b.maxForce = Vector3.new(200,0,200)
  199. Attack = false
  200. FollowOwner = true
  201. Follow = false
  202. Gard = false
  203. end
  204. if string.sub(string.lower(msg), 1, 6) == "color3" then
  205. p.BrickColor = BrickColor.new("Royal purple")
  206. b.maxForce = Vector3.new(200,0,200)
  207. Attack = false
  208. FollowOwner = true
  209. Follow = false
  210. Gard = false
  211. end
  212. if string.sub(string.lower(msg), 1, 5) == "leave" then
  213. m:remove()
  214. script:remove()
  215. end
  216. if string.sub(string.lower(msg), 1, 8) == "commands" then
  217. mss = Instance.new("Message")
  218. mss.Text = "attack/, follow, leave, kick/, follow/, color"
  219. mss.Parent = Owner.Character
  220. wait(2)
  221. mss.Text = "gard, stay, calm"
  222. wait(1)
  223. mss:remove()
  224. end
  225. if string.sub(string.lower(msg), 1, 5) == "kick/" then
  226. c = game.Players:children()
  227. for i = 1, #c do
  228. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 6)) == 1 then
  229. if c[i].Character ~= nil then
  230. Kick = true
  231. Attack = false
  232. FollowOwner = false
  233. b.maxForce = Vector3.new(math.huge,0,math.huge)
  234. b.position = c[i].Character.Torso.Position
  235. p.Position = c[i].Character.Torso.Position
  236. wait(1)
  237. c[i]:remove()
  238. b.maxForce = Vector3.new(200,0,200)
  239. Attack = false
  240. FollowOwner = true
  241. Kick = false
  242. end
  243. wait(1)
  244. c[i]:remove()
  245. end
  246. end
  247. end
  248. if string.sub(string.lower(msg), 1, 7) == "follow/" then
  249. c = game.Players:children()
  250. for i = 1, #c do
  251. if string.find(string.lower(c[i].Name), string.sub(string.lower(msg), 8)) == 1 then
  252. if c[i].Character ~= nil then
  253. FollowP = ""..c[i].Name..""
  254. Follow = true
  255. Attack = false
  256. FollowOwner = false
  257. Gard = false
  258. end
  259. end
  260. end
  261. end
  262. if string.sub(string.lower(msg), 1, 5) == "guard" then
  263. Gard = true
  264. Attack = false
  265. Follow = false
  266. end
  267. if string.sub(string.lower(msg), 1, 4) == "stay" then
  268. FollowOwner = false
  269. Attack = false
  270. Follow = false
  271. Kick = false
  272. b.maxForce = Vector3.new(math.huge,0,math.huge)
  273. end
  274. if string.sub(string.lower(msg), 1, 4) == "calm" then
  275. Attack = false
  276. Gard = false
  277. Kick = false
  278. end
  279. end
  280. Owner.Chatted:connect(chat)
  281.  
  282. --[[ Loop ]]--
  283.  
  284.  
  285. while true do
  286. wait()
  287. if Attack == true then
  288. b.maxForce = Vector3.new(math.huge,0,math.huge)
  289. player = game.Players:findFirstChild(AttackP)
  290. b.position = player.Character.Torso.Position
  291. end
  292. if Follow == true then
  293. wait(2)
  294. b.maxForce = Vector3.new(200,0,200)
  295. player = game.Players:findFirstChild(FollowP)
  296. 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))
  297. end
  298. if FollowOwner == true then
  299. wait(2)
  300. b.maxForce = Vector3.new(200,0,200)
  301. 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))
  302. end
  303. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement