Advertisement
InTesting

VS RblxTrail

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