Advertisement
Prephy

brick v2 test

Mar 7th, 2021
486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.40 KB | None | 0 0
  1. wait()
  2. local oldpose = nil
  3. player=game:GetService("Players").projor22
  4. local mod1 = Instance.new("Model",workspace.Terrain) mod1.Name = ">"..player.Name.."<"
  5. character = player.Character
  6. player.Character = mod1
  7. wait()
  8.  
  9. function cam()
  10.     NLS([[
  11. player=game:GetService("Players").LocalPlayer
  12. mouse=player:GetMouse()
  13. mod=player.Character
  14.  
  15. local brick = Instance.new("FlagStand",mod) brick.Name= "Torso" brick.Size=Vector3.new(2,1,4) brick.Transparency=1
  16. local hum = Instance.new("Humanoid",mod) hum.MaxHealth = -300 hum.Health= -300 hum.Name = "" hum.BreakJointsOnDeath=false hum.RequiresNeck=false hum.WalkSpeed=13  
  17. workspace.CurrentCamera:Destroy()
  18. wait()
  19. workspace.CurrentCamera.CameraSubject = hum
  20. workspace.CurrentCamera.CameraType = "Custom"
  21.  
  22.  
  23. --remotes
  24. local re = player.Backpack:WaitForChild("ok")
  25. local brick1 = player.Backpack:WaitForChild("brick")
  26. local touch = player.Backpack:WaitForChild("touched")
  27. --remotes
  28.  
  29. local RunService = game:GetService("RunService")
  30.  
  31. local RATE_PER_SECOND = 2
  32.  
  33. RunService.RenderStepped:Connect(function(step)
  34.     local increment = RATE_PER_SECOND * step
  35.     if brick1 then
  36.         brick1:FireServer(brick.CFrame)
  37.     end
  38.    
  39. end)
  40.  
  41.  
  42.  
  43. mouse.KeyDown:connect(function(Key)
  44.     Key = Key:lower()
  45.     if  Key == 'z' then
  46.         brick.Position=mouse.Hit.p
  47.     end
  48. end)
  49.  
  50. mouse.KeyDown:connect(function(Key)
  51.     Key = Key:lower()
  52.     if  Key == 'q' then
  53.         re:FireServer("yes")
  54.     end
  55. end)
  56.  
  57. local attack = false
  58. mouse.KeyDown:connect(function(Key)
  59.     Key = Key:lower()
  60.     if  Key == 'x' then
  61.         if attack == false then
  62.             attack=true
  63.             effect(brick)
  64.             wait(1)
  65.             attack=false
  66.         end
  67.     end
  68. end)
  69.  
  70. local anchor = false
  71. mouse.KeyDown:connect(function(Key)
  72.     Key = Key:lower()
  73.     if  Key == 'f' then
  74.         if anchor == false then
  75.             anchor=true
  76.             brick.Anchored=true
  77.         else       
  78.             anchor=false
  79.             brick.Anchored=false
  80.         end
  81.     end
  82. end)
  83.  
  84.  
  85. brick.Touched:Connect(function(victim)
  86.     if victim==workspace.Brick then
  87.     else
  88.         if attack == true then
  89.             touch:FireServer(victim)
  90.             end
  91.         end
  92. end)
  93.  
  94.  
  95.  
  96. function effect(brickpart)
  97.  
  98.     --local brickpart=player.Character.Torso
  99.     local redpart = Instance.new("FlagStand",player.Character) redpart.Material=Enum.Material.Glass
  100.     redpart.CanCollide=false redpart.Transparency=.5
  101.     redpart.CFrame=brickpart.CFrame redpart.Color=Color3.new(0.666667, 0, 0) local welder = Instance.new("Weld",redpart) welder.Part0=redpart welder.Part1=brickpart
  102.     redpart.Size=brickpart.Size + Vector3.new(.1,.1,.1)
  103.     wait(.05)
  104.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1)
  105.     wait(.05)
  106.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1)
  107.     wait(.05)
  108.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  109.     wait(.05)
  110.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  111.     wait(.05)
  112.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1)  redpart.Transparency=redpart.Transparency + .09
  113.     wait(.05)
  114.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  115.     wait(.05)
  116.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  117.     wait(.05)  
  118.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  119.     wait(.05)
  120.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  121.     wait(.05)
  122.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  123.     wait(.05)
  124.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  125.     wait(.05)
  126.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  127.     wait(.05)
  128.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  129.     wait(.05)
  130.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  131.     wait(.05)
  132.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  133.     wait(.05)
  134.     redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
  135.  
  136.  
  137.     redpart:Destroy()
  138. end
  139. ]],player.Backpack)
  140. end
  141.  
  142.  
  143. cam()
  144.  
  145.  
  146.  
  147. --remotes
  148. local RE = Instance.new("RemoteEvent",player.Backpack) RE.Name="ok"
  149. local brickserver = Instance.new("RemoteEvent",player.Backpack) brickserver.Name="brick"
  150. local touch = Instance.new("RemoteEvent",player.Backpack) touch.Name="touched"
  151. --remotes
  152.  
  153.  
  154. RE.OnServerEvent:Connect(function(pl,re)
  155.     refit2()
  156. end)
  157.  
  158. touch.OnServerEvent:Connect(function(pl,Part)
  159.     if Part.Parent.ClassName == "Model" then
  160.         Kill(Part.Parent)
  161.     elseif Part.Parent.Parent.ClassName == "Model" then
  162.         Kill(Part.Parent.Parent)
  163.     end
  164. end)
  165.  
  166.  
  167. local brick = nil
  168. brick = Instance.new("Seat",workspace) brick.Name= "Brick" brick.Size=Vector3.new(2,1,4) brick.CanCollide=false brick.Anchored=true
  169.  
  170.  
  171. brickserver.OnServerEvent:Connect(function(pl,fakebrick)
  172.     if brick then
  173.         brick.CFrame = fakebrick
  174.         oldpose = fakebrick
  175.     end
  176. end)
  177.  
  178.  
  179.  
  180. function Kill(die)
  181.     die:BreakJoints()
  182.     for i,g in pairs(die:GetDescendants()) do
  183.         if g:IsA("BasePart") then
  184.             local lol = nil
  185.             lol = g
  186.             lol.Color = Color3.fromRGB(170, 0, 0)
  187.             lol.Transparency=.3
  188.             lol.Material=Enum.Material.Glass
  189.             local check = g:FindFirstChild("mp3")
  190.             if check then
  191.                 check.Volume = math.random(1,3)
  192.             else
  193.                 local sound = Instance.new("Sound",g)
  194.                 sound.SoundId = "rbxassetid://516789356"
  195.                 sound.Volume = math.random(1,3)
  196.                 sound.PlayOnRemove=true
  197.                 sound.Name="mp3"
  198.             end
  199.             local bp = Instance.new("BodyVelocity",lol)
  200.             bp.MaxForce = Vector3.new(0,math.huge,0)   
  201.             lol.Transparency=.6
  202.             local died = Instance.new("FlagStand",workspace)            died.CanCollide=true
  203.             local mesher = lol:FindFirstChildOfClass("SpecialMesh")
  204.             if mesher then
  205.                 mesher.Parent=died
  206.             end
  207.  
  208.             g:Destroy()
  209.  
  210.  
  211.             died.CFrame=lol.CFrame 
  212.             --  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
  213.             died.Size=lol.Size
  214.             died.Material=lol.Material
  215.             died.Transparency=lol.Transparency
  216.             died.BrickColor=lol.BrickColor
  217.             died.Name='life'
  218.  
  219.         end
  220.     end
  221. end
  222.  
  223.  
  224. function refit()
  225.     brick = Instance.new("Seat",workspace) brick.Name= "Brick" brick.Size=Vector3.new(2,1,4) brick.CanCollide=false brick.Anchored=true
  226. end
  227.  
  228. game.DescendantRemoving:Connect(function(h)
  229.     if h == brick then
  230.         refit()
  231.  
  232.     end
  233. end)
  234.  
  235. game.DescendantRemoving:Connect(function(h)
  236.     if h == mod1 then
  237.         refit2()
  238.  
  239.     end
  240. end)
  241.  
  242. function refit2()
  243.     mod1 = Instance.new("Model",workspace.Terrain) mod1.Name = ">"..player.Name.."<"
  244.     character = player.Character
  245.     player.Character = mod1
  246.     wait()
  247.      cam()
  248.     --remotes
  249.     RE = Instance.new("RemoteEvent",player.Backpack) RE.Name="ok"
  250.     local brickserver2 = Instance.new("RemoteEvent",player.Backpack) brickserver2.Name="brick"
  251.     local touch2 = Instance.new("RemoteEvent",player.Backpack) touch2.Name="touched"
  252.     --remotes
  253.  
  254.     RE.OnServerEvent:Connect(function(pl,re)
  255.         refit2()
  256.     end)
  257.  
  258.     brickserver2.OnServerEvent:Connect(function(pl,fakebrick)
  259.         if brick then
  260.             brick.CFrame = fakebrick
  261.         end
  262.     end)
  263.  
  264.     touch2.OnServerEvent:Connect(function(pl,Part)
  265.         if Part.Parent.ClassName == "Model" then
  266.             Kill(Part.Parent)
  267.         elseif Part.Parent.Parent.ClassName == "Model" then
  268.             Kill(Part.Parent.Parent)
  269.         end
  270.     end)
  271. end
  272.  
  273.  
  274.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement