Prephy

Pet.Brick

Mar 3rd, 2021 (edited)
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.32 KB | None | 0 0
  1. warn[[
  2. Mr.Brick's Pet Brick
  3. Made by projor22
  4.  
  5. Keys:
  6.  
  7. z-teleport
  8. x-attack
  9. p-refit
  10. q-reposition
  11. ]]
  12.  
  13. wait()
  14. local player=owner
  15. local brickpart = {"Seat"}
  16. local brickname = "HumanoidRootPart"
  17. script.Parent=nil
  18. local NAME = "Brick< "..math.random()
  19. local mod = Instance.new("Model",workspace) mod.Name=NAME
  20. local brick = Instance.new(brickpart[math.random(1,#brickpart)],mod) brick.Name= brickname brick.Size=Vector3.new(2,1,4)
  21. local oldpos = nil
  22. oldpos=brick
  23. local respawn=true
  24.  
  25. function camera()
  26. NLS([[local player = game:GetService("Players").LocalPlayer
  27. local mouse = player:GetMouse()
  28. local teleport=player.Backpack:WaitForChild("tels")
  29. local refitter=player.Backpack:WaitForChild("reset")
  30. local attack =player.Backpack:WaitForChild("attack")
  31. local repos = player.Backpack:WaitForChild("reposition")
  32. local brick=player.Character:FindFirstChild("HumanoidRootPart")
  33. local hum = Instance.new("Humanoid",player.Character) hum.MaxHealth = 300 hum.Health=300 hum.Name = "" hum.BreakJointsOnDeath=false hum.RequiresNeck=false hum.WalkSpeed=13
  34. workspace.CurrentCamera.CameraSubject = hum
  35. --workspace.CurrentCamera.CameraType = "Custom"
  36. local brickf = Instance.new("FlagStand",player.Character) brickf.Name= "Brick" brickf.Size=Vector3.new(2,1,4)
  37. local weld = Instance.new("Weld",brick) weld.Part0=brick weld.Part1= brickf
  38. brick.Transparency=2
  39. mouse.KeyDown:connect(function(Key)
  40. Key = Key:lower()
  41. if Key == 'z' then
  42. teleport:FireServer(mouse.Hit.p)
  43. end
  44. end)
  45. mouse.KeyDown:connect(function(Key)
  46. Key = Key:lower()
  47. if Key == 'x' then
  48. attack:FireServer(brick)
  49. end
  50. end)
  51. mouse.KeyDown:connect(function(Key)
  52. Key = Key:lower()
  53. if Key == 'p' then
  54. refitter:FireServer("reset")
  55.  
  56. end
  57. end)
  58.  
  59. mouse.KeyDown:connect(function(Key)
  60. Key = Key:lower()
  61. if Key == 'q' then
  62. repos:FireServer("repos")
  63.  
  64. end
  65. end)
  66. ]],player.Backpack)
  67.  
  68. end
  69.  
  70. local character = player.Character
  71. if character then
  72. local head= character:FindFirstChild("Head")
  73. if head then
  74. brick.CFrame=head.CFrame player.Character=mod camera()
  75. else
  76. player.Character=mod camera()
  77. end
  78. end
  79.  
  80. function resp()
  81. respawn=false
  82. local killr3=false
  83. player:LoadCharacter()
  84. local funnies = player.Character:FindFirstChildOfClass("Part")
  85. NAME = "Brick< "..math.random()
  86. local mod3 = Instance.new("Model",workspace) mod3.Name=NAME
  87. local brick3 = Instance.new(brickpart[math.random(1,#brickpart)],mod3) brick3.Name= brickname brick3.Size=Vector3.new(2,1,4) brick3.Position=funnies.Position
  88. player.Character=mod3
  89. oldpos=brick3
  90. local respawn3 = Instance.new("RemoteEvent",player.Backpack) respawn3.Name="reposition"
  91. local attack3 = Instance.new("RemoteEvent",player.Backpack) attack3.Name="attack"
  92. local tele3= Instance.new("RemoteEvent",player.Backpack) tele3.Name="tels"
  93. local refitter3 = Instance.new("RemoteEvent",player.Backpack) refitter3.Name="reset"
  94. camera()
  95.  
  96. refitter3.OnServerEvent:connect(function(plr, omaga)
  97. refit()
  98. end)
  99.  
  100. tele3.OnServerEvent:connect(function(plr, position)
  101. brick3.Position=position
  102. end)
  103.  
  104. respawn3.OnServerEvent:connect(function(plr, repo)
  105. resp()
  106. end)
  107.  
  108. brick3.Touched:Connect(function(Part)
  109. if killr3==true then
  110. if Part.Parent.ClassName == "Model" then
  111. Kill(Part.Parent)
  112. elseif Part.Parent.Parent.ClassName == "Model" then
  113. Kill(Part.Parent.Parent)
  114. end
  115.  
  116.  
  117.  
  118.  
  119.  
  120. end
  121.  
  122.  
  123. end)
  124.  
  125. attack3.OnServerEvent:connect(function(plr, plrpart)
  126. killr3=true
  127. effect(plrpart)
  128. wait(.5)
  129. killr3=false
  130.  
  131.  
  132. end)
  133. respawn=true
  134. end
  135.  
  136. --remotes
  137. local respawn1 = Instance.new("RemoteEvent",player.Backpack) respawn1.Name="reposition"
  138. local refitter = Instance.new("RemoteEvent",player.Backpack) refitter.Name="reset"
  139. local attack = Instance.new("RemoteEvent",player.Backpack) attack.Name="attack"
  140. local tele= Instance.new("RemoteEvent",player.Backpack) tele.Name="tels"
  141. --remotes
  142.  
  143. refitter.OnServerEvent:connect(function(plr, omaga)
  144. refit()
  145. end)
  146.  
  147.  
  148. tele.OnServerEvent:connect(function(plr, position)
  149. brick.Position=position
  150. end)
  151.  
  152. respawn1.OnServerEvent:connect(function(plr, repo)
  153. resp()
  154. end)
  155.  
  156. function Kill(die)
  157. die:BreakJoints()
  158. for i,g in pairs(die:GetDescendants()) do
  159. if g:IsA("BasePart") then
  160. local lol = nil
  161. lol = g
  162. lol.Color = Color3.fromRGB(170, 0, 0)
  163. lol.Transparency=.3
  164. lol.Material=Enum.Material.Glass
  165. local check = player.Character.HumanoidRootPart:FindFirstChild("mp3")
  166. if check then
  167. check.Volume = math.random(1,3)
  168. check:Play()
  169. else
  170. local sound = Instance.new("Sound",player.Character.HumanoidRootPart)
  171. sound.SoundId = "rbxassetid://516789356"
  172. sound.Volume = math.random(1,3)
  173. -- sound.PlayOnRemove=true
  174. sound.Name="mp3"
  175. end
  176. local bp = Instance.new("BodyVelocity",lol)
  177. bp.MaxForce = Vector3.new(0,math.huge,0)
  178. lol.Transparency=.6
  179. local died = Instance.new(brickpart[math.random(1,#brickpart)],workspace) died.Disabled=true died.CanCollide=true
  180. local mesher = lol:FindFirstChildOfClass("SpecialMesh")
  181. if mesher then
  182. mesher.Parent=died
  183. died.BrickColor=BrickColor.new("Really Black")
  184. mesher.TextureId=""
  185. else
  186. end
  187.  
  188. g:Destroy()
  189.  
  190.  
  191. died.CFrame=lol.CFrame
  192. -- local particle1 = Instance.new("FlagStand",died) particle1.Size=Vector3.new(math.random(),math.random(),math.random()) particle1.Color=Color3.new() particle1.Transparency=.6 particle1.CFrame=died.CFrame
  193. died.Size=lol.Size
  194. died.Material=lol.Material
  195. died.Transparency=lol.Transparency
  196. died.BrickColor=lol.BrickColor
  197. died.Name="Shattered "..lol.Name
  198.  
  199. end
  200. end
  201. end
  202. function effect(brickpart)
  203.  
  204. local redpart = Instance.new("FlagStand",player.Character) redpart.Material=Enum.Material.Glass
  205. redpart.CanCollide=false redpart.Transparency=.5
  206. redpart.CFrame=brickpart.CFrame redpart.Color=Color3.new(0.666667, 0, 0) local welder = Instance.new("Weld",redpart) welder.Part0=redpart welder.Part1=brickpart
  207. redpart.Size=brickpart.Size + Vector3.new(.1,.1,.1)
  208. wait(.05)
  209. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1)
  210. wait(.05)
  211. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1)
  212. wait(.05)
  213. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  214. wait(.05)
  215. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  216. wait(.05)
  217. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  218. wait(.05)
  219. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  220. wait(.05)
  221. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  222. wait(.05)
  223. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  224. wait(.05)
  225. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  226. wait(.05)
  227. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  228. wait(.05)
  229. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  230. wait(.05)
  231. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  232. wait(.05)
  233. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  234. wait(.05)
  235. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  236. wait(.05)
  237. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  238. wait(.05)
  239. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  240. wait(.05)
  241. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  242. wait(.05)
  243. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  244. wait(.05)
  245. redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  246. wait(.05)
  247. redpart:Destroy()
  248. end
  249. local killr = false
  250. brick.Touched:Connect(function(Part)
  251. if killr==true then
  252. if Part.Parent.ClassName == "Model" then
  253. Kill(Part.Parent)
  254. elseif Part.Parent.Parent.ClassName == "Model" then
  255. Kill(Part.Parent.Parent)
  256. end
  257.  
  258.  
  259.  
  260.  
  261.  
  262. end
  263.  
  264.  
  265. end)
  266. attack.OnServerEvent:connect(function(plr, plrpart)
  267. killr=true
  268.  
  269. effect(plrpart)
  270. wait(.5)
  271. killr=false
  272.  
  273. end)
  274.  
  275.  
  276. function refit()
  277. local killr2=false
  278. NAME = "Brick< "..math.random()
  279. local mod2 = Instance.new("Model",workspace) mod2.Name=NAME
  280. local brick2 = Instance.new(brickpart[math.random(1,#brickpart)],mod2) brick2.Name= brickname brick2.Size=Vector3.new(2,1,4)
  281. brick2.CFrame=oldpos.CFrame
  282. oldpos=brick2
  283. player.Character=mod2
  284. local respawn2 = Instance.new("RemoteEvent",player.Backpack) respawn2.Name="reposition"
  285. local attack2 = Instance.new("RemoteEvent",player.Backpack) attack2.Name="attack"
  286. local tele2= Instance.new("RemoteEvent",player.Backpack) tele2.Name="tels"
  287. local refitter2 = Instance.new("RemoteEvent",player.Backpack) refitter2.Name="reset" camera()
  288.  
  289. refitter2.OnServerEvent:connect(function(plr, omaga)
  290. refit()
  291. end)
  292.  
  293. tele2.OnServerEvent:connect(function(plr, position)
  294. brick2.Position=position
  295. end)
  296.  
  297. respawn2.OnServerEvent:connect(function(plr, repo)
  298. resp()
  299. end)
  300.  
  301. brick2.Touched:Connect(function(Part)
  302. if killr2==true then
  303. if Part.Parent.ClassName == "Model" then
  304. Kill(Part.Parent)
  305. elseif Part.Parent.Parent.ClassName == "Model" then
  306. Kill(Part.Parent.Parent)
  307. end
  308.  
  309.  
  310.  
  311.  
  312.  
  313. end
  314.  
  315. end)
  316.  
  317. attack2.OnServerEvent:connect(function(plr, plrpart)
  318. killr2=true
  319. effect(plrpart)
  320. wait(.5)
  321. killr2=false
  322.  
  323.  
  324. end)
  325.  
  326.  
  327. end
  328.  
  329.  
  330.  
  331.  
  332. local RunService = game:GetService("RunService")
  333. local RATE_PER_SECOND = 2
  334. RunService.Heartbeat:Connect(function(step)
  335. local increment = RATE_PER_SECOND * step
  336. local refit_pet = workspace:FindFirstChild(NAME)
  337. if refit_pet then
  338. local refit_brick = player.Character:FindFirstChild(brickname)
  339. if refit_brick then
  340.  
  341. else
  342. if respawn==true then
  343. refit()
  344. end
  345. end
  346. else
  347. if respawn==true then
  348. refit()
  349. end
  350.  
  351.  
  352. end
  353.  
  354. local torsomoment = player.Character:FindFirstChild(brickname)
  355. if torsomoment then
  356. torsomoment.Size=Vector3.new(2,1,4)
  357. torsomoment.Material=Enum.Material.Plastic
  358. torsomoment.BrickColor=BrickColor.new("Medium Stone Grey")
  359. end
  360.  
  361. end)
  362.  
  363.  
Add Comment
Please, Sign In to add comment