Advertisement
InTesting

VS Passive Shield (No Damage Given)

Dec 9th, 2018
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.13 KB | None | 0 0
  1. local player = owner
  2. local person = owner.Character
  3.  
  4. if person==nil then
  5. else
  6.     local part = Instance.new("Part")
  7.     local box = person:GetExtentsSize()
  8.     local attachment = Instance.new("Attachment")
  9.     attachment.Position = Vector3.new(0,0,person:GetExtentsSize().Z*-2)
  10.     attachment.Parent = person.HumanoidRootPart
  11.     part.CanCollide = false
  12.     part.Transparency = .75
  13.     part.BrickColor = BrickColor.new("Cyan")
  14.     part.Material = Enum.Material.Granite
  15.     part.Massless = true
  16.     part.Size = Vector3.new(person:GetExtentsSize().Y*3,person:GetExtentsSize().Y*3,1)
  17.     part.Position = attachment.WorldPosition
  18.     part.Orientation = person.HumanoidRootPart.Orientation
  19.     part.Parent = person
  20.     local weld = Instance.new("WeldConstraint")
  21.     weld.Part0 =part
  22.     weld.Part1 = person.HumanoidRootPart
  23.     weld.Parent = person
  24.     part.Touched:Connect(function(hit)
  25.         if hit.Parent.Name==person.Name then
  26.         else
  27.             local head = hit.Parent:FindFirstChild("Head")
  28.             local HRP = hit.Parent:FindFirstChild("HumanoidRootPart")
  29.             if hit.Parent:FindFirstChild("Humanoid") then
  30.                 hit.Parent.Humanoid.PlatformStand = true
  31.                 local char = hit.Parent
  32.                 local rope = Instance.new("RopeConstraint")
  33.                
  34.                 if person.Humanoid.RigType==Enum.HumanoidRigType.R15 then
  35.                     rope.Attachment0 = person.LeftHand.LeftGripAttachment
  36.                 elseif person.Humanoid.RigType==Enum.HumanoidRigType.R6 then
  37.                     local attachment2 = Instance.new("Attachment")
  38.                     attachment2.Position = Vector3.new(0,-1,0)
  39.                     attachment2.Parent = person["Left Arm"]
  40.                     rope.Attachment0 = attachment2
  41.                 end
  42.                
  43.                
  44.                 if char.Humanoid.RigType==Enum.HumanoidRigType.R15 then
  45.                     rope.Attachment1 = char.Head.FaceFrontAttachment
  46.                 elseif char.Humanoid.RigType==Enum.HumanoidRigType.R6 then
  47.                     local attachment1 = Instance.new("Attachment")
  48.                     attachment1.Position = Vector3.new(0,-.5,0)
  49.                     attachment1.Parent = char.Head
  50.                     rope.Attachment1 = attachment1
  51.                 end
  52.                 local charC = char:GetChildren()
  53.                 for i=1, #charC do
  54.                     if charC[i]:IsA("MeshPart") or charC[i]:IsA("Part") then
  55.                         charC[i].Massless = false
  56.                     end
  57.                 end
  58.                 rope.Length = 20
  59.                 rope.Visible = true
  60.                 rope.Parent = person
  61.             elseif head then
  62.                 head.Anchored = true
  63.             elseif HRP then
  64.                 HRP.Anchored = true
  65.             elseif hit.Parent:FindFirstChild("Humanoid") then
  66.                 local humanoid = hit.Parent:FindFirstChild("Humanoid")
  67.                 if humanoid.PlatformStand==false then
  68.                 else
  69.                 part:Destroy()
  70.                 local part = Instance.new("Part")
  71.                 part.CanCollide = false
  72.                 part.Transparency = .75
  73.                 part.BrickColor = BrickColor.new("Really red")
  74.                 part.Material = Enum.Material.Granite
  75.                 part.Massless = true
  76.                 part.Size = Vector3.new(person:GetExtentsSize().Y*3,person:GetExtentsSize().Y*3,1)
  77.                 part.Position = attachment.WorldPosition
  78.                 part.Orientation = person.HumanoidRootPart.Orientation
  79.                 part.Parent = person
  80.                
  81.                 local weld = Instance.new("WeldConstraint",part)
  82.                 weld.Part1 = part
  83.                 weld.Part0 = person.HumanoidRootPart
  84.                 end
  85.             end
  86.         end
  87.     end)
  88. if person.Name=="SoftlockedUnderZero" then
  89.         local torso = person.UpperTorso
  90.         local part3 = Instance.new("Part")
  91.         local attachment2 = Instance.new("Attachment")
  92.         part3.CanCollide = false
  93.         attachment2.Position = Vector3.new(torso.Size.X*.25,torso.Size.Y*.15,torso.Size.Z*-.25)
  94.         part3.Shape = "Ball"
  95.         part3.Size = Vector3.new(torso.Size.X/2,torso.Size.X/2,torso.Size.X/2)
  96.         attachment2.Parent = torso
  97.         part3.Position = attachment2.WorldPosition
  98.         part3.Anchored = false
  99.         part3.BrickColor = person["Body Colors"].TorsoColor
  100.         part3.Parent = person
  101.         local weld = Instance.new("WeldConstraint")
  102.         weld.Part1 = torso
  103.         weld.Part0 = part3
  104.         weld.Parent = torso
  105.         local part4 = Instance.new("Part")
  106.         local attachment3 = Instance.new("Attachment")
  107.         part4.CanCollide = false
  108.         attachment3.Position = Vector3.new(torso.Size.X*-.25,torso.Size.Y*.15,torso.Size.Z*-.25)
  109.         part4.Shape = "Ball"
  110.         part4.Size = Vector3.new(torso.Size.X/2,torso.Size.X/2,torso.Size.X/2)
  111.         attachment3.Parent = torso
  112.         part4.Position = attachment3.WorldPosition
  113.         part4.Anchored = false
  114.         part4.BrickColor = person["Body Colors"].TorsoColor
  115.         part4.Parent = person
  116.         local weld = Instance.new("WeldConstraint")
  117.         weld.Part1 = torso
  118.         weld.Part0 = part4
  119.         weld.Parent = torso
  120.         local part5 = Instance.new("Part")
  121.         local attachment4 = Instance.new("Attachment")
  122.         part5.CanCollide = false
  123.         attachment4.Position = Vector3.new(0,torso.Size.Y*.15,torso.Size.Z*-.25)
  124.         part5.Shape = "Cylinder"
  125.         part5.Size = Vector3.new(torso.Size.X/2,torso.Size.X/2,torso.Size.X/2)
  126.         attachment4.Parent = torso
  127.         part5.Position = attachment4.WorldPosition
  128.         part5.Orientation = torso.Orientation
  129.         part5.Anchored = false
  130.         part5.BrickColor = person["Body Colors"].TorsoColor
  131.         part5.Parent = person
  132.         local weld = Instance.new("WeldConstraint")
  133.         weld.Part1 = torso
  134.         weld.Part0 = part5
  135.         weld.Parent = torso
  136.         part3.TopSurface = "Smooth"
  137.         part4.TopSurface = "Smooth"
  138.         part5.TopSurface = "Smooth"
  139.         part3.BottomSurface = "Smooth"
  140.         part4.BottomSurface = "Smooth"
  141.         part5.BottomSurface = "Smooth"
  142.     end
  143.     while true do
  144.         person.Humanoid.Health = "inf"
  145.         person.Humanoid.PlatformStand = false
  146.         person.Humanoid.WalkSpeed = 75
  147.         person.Humanoid.JumpPower = 100
  148.         person.Humanoid.MaxHealth = "inf"
  149.         wait(.5)
  150.     end
  151. end
  152.  
  153.  
  154. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  155. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  156. do
  157.     print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  158.     script.Parent = Player.Character
  159.  
  160.     --RemoteEvent for communicating
  161.     local Event = Instance.new("RemoteEvent")
  162.     Event.Name = "UserInput_Event"
  163.     --Fake event to make stuff like Mouse.KeyDown work
  164.     local function fakeEvent()
  165.         local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  166.         t.connect = t.Connect
  167.         return t
  168.     end
  169.     --Creating fake input objects with fake variables
  170.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  171.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  172.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  173.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  174.     end}
  175.     --Merged 2 functions into one by checking amount of arguments
  176.     CAS.UnbindAction = CAS.BindAction
  177.  
  178.     --This function will trigger the events that have been :Connect()'ed
  179.     local function te(self,ev,...)
  180.         local t = m[ev]
  181.         if t and t._fakeEvent and t.Function then
  182.             t.Function(...)
  183.         end
  184.     end
  185.     m.TrigEvent = te
  186.     UIS.TrigEvent = te
  187.     Event.OnServerEvent:Connect(function(plr,io)
  188.         if plr~=Player then return end
  189.         if io.isMouse then
  190.             m.Target = io.Target
  191.             m.Hit = io.Hit
  192.         else
  193.             local b = io.UserInputState == Enum.UserInputState.Begin
  194.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  195.                 return m:TrigEvent(b and "Button1Down" or "Button1Up")
  196.             end
  197.             for _,t in pairs(CAS.Actions) do
  198.                 for _,k in pairs(t.Keys) do
  199.                     if k==io.KeyCode then
  200.                         t.Function(t.Name,io.UserInputState,io)
  201.                     end
  202.                 end
  203.             end
  204.             m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  205.             UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  206.         end
  207.     end)
  208.     Event.Parent = NLS([==[
  209.     local Player = game:GetService("Players").LocalPlayer
  210.     local Event = script:WaitForChild("UserInput_Event")
  211.     local UIS = game:GetService("UserInputService")
  212.     local input = function(io,a)
  213.         if a then return end
  214.         --Since InputObject is a client-side instance, we create and pass table instead
  215.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  216.     end
  217.     UIS.InputBegan:Connect(input)
  218.     UIS.InputEnded:Connect(input)
  219.     local Mouse = Player:GetMouse()
  220.     local h,t
  221.     --Give the server mouse data 30 times every second, but only if the values changed
  222.     --If player is not moving their mouse, client won't fire events
  223.     while wait(1/30) do
  224.         if h~=Mouse.Hit or t~=Mouse.Target then
  225.             h,t=Mouse.Hit,Mouse.Target
  226.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  227.         end
  228.     end]==],Player.Character)
  229.     Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  230. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement