Advertisement
InTesting

VS Lava Shield

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