Advertisement
Prephy

shattered figure

Mar 8th, 2021
754
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.63 KB | None | 0 0
  1. warn[[
  2. Shattered figure, made by projor22
  3.  
  4. buttons:
  5. z - teleport
  6. x - attack
  7. c - wave
  8. f - anchor/unanchor
  9. ]]
  10.  
  11. wait()
  12. player = owner
  13. script.Parent=nil
  14. local attack=false
  15. local anchored=false
  16. local name = " Shattered Figure "
  17.  
  18.  
  19.  
  20. --character/joints
  21. local old = nil
  22. local mod = Instance.new("Model",workspace) mod.Name="> "..name.." <"
  23. local hed = Instance.new("FlagStand",mod) hed.Size = Vector3.new(2,1,1) hed.Name = "Head" hed.Transparency=0 hed.Anchored=false hed.CanCollide=false hed.Material=Enum.Material.Glass hed.Transparency=.3 hed.Color = Color3.fromRGB(130, 0, 0)
  24. local mesh = Instance.new("SpecialMesh",hed) mesh.MeshId="rbxassetid://1104623876" mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  25. local tor = Instance.new("FlagStand",mod) tor.Name = "Torso" tor.Size = Vector3.new(2,2,1) tor.Transparency=0 tor.Anchored=false tor.CanCollide=true tor.Material=Enum.Material.Glass tor.Transparency=.3 tor.Color = Color3.fromRGB(170, 0, 0)
  26. local right_arm = Instance.new("FlagStand",mod) right_arm.Size=Vector3.new(1,2,1) right_arm.Transparency=0 right_arm.Name = "Right Arm" right_arm.Anchored=false right_arm.Material=Enum.Material.Glass right_arm.Transparency=.3 right_arm.Color = Color3.fromRGB(170, 0, 0)
  27. local left_arm = Instance.new("FlagStand",mod) left_arm.Size=Vector3.new(1,2,1) left_arm.Transparency=0 left_arm.Name = "Left Arm" left_arm.Anchored=false  left_arm.Material=Enum.Material.Glass left_arm.Transparency=.3 left_arm.Color = Color3.fromRGB(170, 0, 0)
  28. local right_leg = Instance.new("FlagStand",mod) right_leg.Size=Vector3.new(1,2,1) right_leg.Transparency=0 right_leg.Name = "Right Leg" right_leg.Anchored=false right_leg.Material=Enum.Material.Glass right_leg.Transparency=.3 right_leg.Color = Color3.fromRGB(170, 0, 0)
  29. local left_leg = Instance.new("FlagStand",mod) left_leg.Size=Vector3.new(1,2,1) left_leg.Transparency=0 left_leg.Name = "Left Leg" left_leg.Anchored=false left_leg.Material=Enum.Material.Glass left_leg.Transparency=.3 left_leg.Color = Color3.fromRGB(170, 0, 0)
  30. Torso = tor
  31. old=hed
  32. function makeJoint(limbName, jointName, c0, c1)
  33.     local limb = limbName
  34.     limb:BreakJoints()
  35.     local joint = Instance.new"Motor"
  36.     joint.Name = jointName
  37.     joint.Part0 = Torso
  38.     joint.Part1 = limb
  39.     joint.C0 = c0
  40.     joint.C1 = c1
  41.     joint.MaxVelocity = 0.3
  42.     joint.archivable = false
  43.     joint.Parent = Torso
  44.     return joint
  45. end
  46. local Neck = makeJoint(hed,"Neck", CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0))
  47. local RightShoulder = makeJoint(right_arm, "Right Shoulder", CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0))
  48. local LeftShoulder = makeJoint(left_arm, "Left Shoulder", CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0))
  49. local RightHip = makeJoint(right_leg, "Right Hip", CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0))
  50. local LeftHip = makeJoint(left_leg, "Left Hip", CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0))
  51. --character/joints
  52.  
  53. --kill
  54. function Kill(die)
  55.     die:BreakJoints()
  56.     for i,g in pairs(die:GetDescendants()) do
  57.         if g:IsA("BasePart") then
  58.             local lol = nil
  59.             lol = g
  60.             lol.Color = Color3.fromRGB(170, 0, 0)
  61.             lol.Transparency=.3
  62.             lol.Material=Enum.Material.Glass
  63.             local check = player.Character.Torso:FindFirstChild("mp3")
  64.             if check then
  65.                 check.Volume = math.random(1,3)
  66.                 check:Play()
  67.             else
  68.                 local sound = Instance.new("Sound",player.Character.Torso)
  69.                 sound.SoundId = "rbxassetid://516789356"
  70.                 sound.Volume = math.random(1,3)
  71.                 --  sound.PlayOnRemove=true
  72.                 sound.Name="mp3"
  73.             end
  74.             local bp = Instance.new("BodyVelocity",lol)
  75.             bp.MaxForce = Vector3.new(0,math.huge,0)   
  76.             lol.Transparency=.6
  77.             local died = Instance.new("FlagStand",workspace)            died.CanCollide=true
  78.             local mesher = lol:FindFirstChildOfClass("SpecialMesh")
  79.             if mesher then
  80.                 mesher.Parent=died
  81.             end
  82.  
  83.             g:Destroy()
  84.  
  85.  
  86.             died.CFrame=lol.CFrame 
  87.             --  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
  88.             died.Size=lol.Size
  89.             died.Material=lol.Material
  90.             died.Transparency=lol.Transparency
  91.             died.BrickColor=lol.BrickColor
  92.             died.Name= "Shattered "..lol.Name
  93.  
  94.         end
  95.     end
  96. end
  97. --kill
  98.  
  99.  
  100.  
  101. function remotes()
  102.     --remotes
  103.     local anchor = Instance.new("RemoteEvent",player.Backpack) anchor.Name="134"
  104.     local tp = Instance.new("RemoteEvent",player.Backpack) tp.Name="12345"
  105.     local wave = Instance.new("RemoteEvent",player.Backpack) wave.Name = "UR3q985"
  106.     local at = Instance.new("RemoteEvent",player.Backpack) at.Name="0813"
  107. --remotes
  108.    
  109.    
  110.     tor.Touched:Connect(function(Part)
  111.         if attack==true then
  112.             if Part.Parent.ClassName == "Model" then
  113.                 Kill(Part.Parent)
  114.             elseif Part.Parent.Parent.ClassName == "Model" then
  115.                 Kill(Part.Parent.Parent)
  116.             end
  117.  
  118.  
  119.  
  120.  
  121.  
  122.         end
  123.  
  124.  
  125.     end)
  126.    
  127.    
  128.  
  129.     --server events
  130.    
  131.     anchor.OnServerEvent:Connect(function(lol,an)
  132.         if anchored==false then
  133.             anchored=true
  134.             tor.Anchored=true
  135.         else
  136.             anchored=false
  137.             tor.Anchored=false
  138.         end
  139.     end)
  140.    
  141.     tp.OnServerEvent:Connect(function(FART, position)
  142.         tor.Position = position + Vector3.new(0,5,0)
  143.     end)
  144.    
  145.     at.OnServerEvent:Connect(function(fart, att)
  146.         if attack==false then
  147.             attack=true
  148.             local motor1 =  tor:FindFirstChild("Right Shoulder")
  149.             local motor2 = tor:FindFirstChild("Left Shoulder")
  150.             if motor1 then
  151.                 if motor2 then
  152.                     motor2.DesiredAngle=-1.56
  153.                 end
  154.                 motor1.DesiredAngle=1.56
  155.             end
  156.         else
  157.             attack=false
  158.             local motor3 =  tor:FindFirstChild("Right Shoulder")
  159.             local motor4 = tor:FindFirstChild("Left Shoulder")
  160.             if motor3 then
  161.                 if motor4 then
  162.                     motor4.DesiredAngle=0
  163.                 end
  164.                 motor3.DesiredAngle=0
  165.             end
  166.         end
  167.     end)
  168.    
  169.     local WAV = false
  170.     wave.OnServerEvent:Connect(function(fat, wav)
  171.         if mod then
  172.             local motor = tor:FindFirstChild("Right Shoulder")
  173.             if motor then
  174.                 if WAV==false then
  175.                     WAV=true
  176.                     motor.DesiredAngle=3.14
  177.                 else
  178.                     WAV=false
  179.                     motor.DesiredAngle=0
  180.                 end
  181.             end
  182.         end
  183.     end)
  184.    
  185.    
  186.  
  187. end
  188.  
  189.  
  190.  
  191.  
  192. function refit1()
  193.     player.Character=mod
  194.     wait()
  195.     NLS([[
  196.     local player = game:GetService("Players").LocalPlayer
  197. local mouse = player:GetMouse()
  198.  
  199. local hum = Instance.new("Humanoid",player.Character) hum.MaxHealth = 300 hum.Health=300 hum.Name = "" hum.BreakJointsOnDeath=false hum.RequiresNeck=false hum.WalkSpeed=13  
  200.  
  201. workspace.CurrentCamera:Destroy()
  202. wait()
  203. workspace.CurrentCamera.CameraSubject = hum
  204. workspace.CurrentCamera.CameraType = "Custom"
  205.  
  206. --remotes
  207. local ancho = player.Backpack:WaitForChild("134")
  208. local wave = player.Backpack:WaitForChild("UR3q985")
  209. local attack = player.Backpack:WaitForChild("0813")
  210. local tp = player.Backpack:WaitForChild("12345")
  211.  
  212. --
  213.  
  214. mouse.KeyDown:connect(function(Key)
  215.     Key = Key:lower()
  216.     if  Key == 'f' then
  217.         ancho:FireServer("WHAT")
  218.  
  219.     end
  220. end)
  221.  
  222.  
  223. mouse.KeyDown:connect(function(Key)
  224.     Key = Key:lower()
  225.     if  Key == 'z' then
  226.         tp:FireServer(mouse.Hit.p)
  227.  
  228.     end
  229. end)
  230.  
  231. mouse.KeyDown:connect(function(Key)
  232.     Key = Key:lower()
  233.     if  Key == 'x' then
  234.         attack:FireServer("beam")
  235.  
  236.     end
  237. end)
  238.  
  239.  
  240. mouse.KeyDown:connect(function(Key)
  241.     Key = Key:lower()
  242.     if  Key == 'c' then
  243.         wave:FireServer("noice")
  244.  
  245.     end
  246. end)
  247.  
  248.     ]],player.Backpack)
  249.    
  250.     remotes()
  251. end
  252.  
  253. local character = player.Character
  254. if character then
  255.     local head = character:FindFirstChild("Head")
  256.     if head then
  257.         hed.CFrame=head.CFrame
  258.         refit1()
  259.        
  260.     else
  261.         refit1()
  262.     end
  263. end
  264.  
  265.  
  266. function refit()
  267.      mod = Instance.new("Model",workspace) mod.Name="> "..name.." <"
  268.     hed = Instance.new("FlagStand",mod) hed.Size = Vector3.new(2,1,1) hed.Name = "Head" hed.Transparency=0 hed.Anchored=false hed.CanCollide=false hed.Material=Enum.Material.Glass hed.Transparency=.3 hed.Color = Color3.fromRGB(130, 0, 0)
  269.      mesh = Instance.new("SpecialMesh",hed) mesh.MeshId="rbxassetid://1104623876" mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  270.     tor = Instance.new("FlagStand",mod) tor.Name = "Torso" tor.Size = Vector3.new(2,2,1) tor.Transparency=0 tor.Anchored=false tor.CanCollide=true tor.Material=Enum.Material.Glass tor.Transparency=.3 tor.Color = Color3.fromRGB(170, 0, 0)
  271.     right_arm = Instance.new("FlagStand",mod) right_arm.Size=Vector3.new(1,2,1) right_arm.Transparency=0 right_arm.Name = "Right Arm" right_arm.Anchored=false right_arm.Material=Enum.Material.Glass right_arm.Transparency=.3 right_arm.Color = Color3.fromRGB(170, 0, 0)
  272.     left_arm = Instance.new("FlagStand",mod) left_arm.Size=Vector3.new(1,2,1) left_arm.Transparency=0 left_arm.Name = "Left Arm" left_arm.Anchored=false  left_arm.Material=Enum.Material.Glass left_arm.Transparency=.3 left_arm.Color = Color3.fromRGB(170, 0, 0)
  273.     right_leg = Instance.new("FlagStand",mod) right_leg.Size=Vector3.new(1,2,1) right_leg.Transparency=0 right_leg.Name = "Right Leg" right_leg.Anchored=false right_leg.Material=Enum.Material.Glass right_leg.Transparency=.3 right_leg.Color = Color3.fromRGB(170, 0, 0)
  274.     left_leg = Instance.new("FlagStand",mod) left_leg.Size=Vector3.new(1,2,1) left_leg.Transparency=0 left_leg.Name = "Left Leg" left_leg.Anchored=false left_leg.Material=Enum.Material.Glass left_leg.Transparency=.3 left_leg.Color = Color3.fromRGB(170, 0, 0)
  275.      Torso = tor
  276.     function makeJoint(limbName, jointName, c0, c1)
  277.         local limb = limbName
  278.         limb:BreakJoints()
  279.         local joint = Instance.new"Motor"
  280.         joint.Name = jointName
  281.         joint.Part0 = Torso
  282.         joint.Part1 = limb
  283.         joint.C0 = c0
  284.         joint.C1 = c1
  285.         joint.MaxVelocity = 0.3
  286.         joint.archivable = false
  287.         joint.Parent = Torso
  288.         return joint
  289.     end
  290.     local Neck = makeJoint(hed,"Neck", CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0))
  291.     local RightShoulder = makeJoint(right_arm, "Right Shoulder", CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0))
  292.     local LeftShoulder = makeJoint(left_arm, "Left Shoulder", CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0))
  293.     local RightHip = makeJoint(right_leg, "Right Hip", CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0))
  294.     local LeftHip = makeJoint(left_leg, "Left Hip", CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0))
  295.     hed.CFrame = old.CFrame
  296.     old=hed
  297.     refit1()
  298. end
  299.  
  300.  
  301.  
  302.  
  303. game.DescendantRemoving:Connect(function(h)
  304.         if  h:IsDescendantOf(mod) then
  305.             refit()
  306.     end
  307. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement