DaRealDreamz193

dodge script for void

Jul 17th, 2019
770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.33 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  5. print("Reposted because iPxter deleted the url.")
  6. script.Parent = Player.Character
  7.  
  8. --RemoteEvent for communicating
  9. local Event = Instance.new("RemoteEvent")
  10. Event.Name = "UserInput_Event"
  11.  
  12. --Fake event to make stuff like Mouse.KeyDown work
  13. local function fakeEvent()
  14. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  15. t.connect = t.Connect
  16. return t
  17. end
  18.  
  19. --Creating fake input objects with fake variables
  20. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  21. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  22. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  23. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  24. end}
  25. --Merged 2 functions into one by checking amount of arguments
  26. CAS.UnbindAction = CAS.BindAction
  27.  
  28. --This function will trigger the events that have been :Connect()'ed
  29. local function te(self,ev,...)
  30. local t = m[ev]
  31. if t and t._fakeEvent and t.Function then
  32. t.Function(...)
  33. end
  34. end
  35. m.TrigEvent = te
  36. UIS.TrigEvent = te
  37.  
  38. Event.OnServerEvent:Connect(function(plr,io)
  39. if plr~=Player then return end
  40. if io.isMouse then
  41. m.Target = io.Target
  42. m.Hit = io.Hit
  43. else
  44. local b = io.UserInputState == Enum.UserInputState.Begin
  45. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  46. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  47. end
  48. for _,t in pairs(CAS.Actions) do
  49. for _,k in pairs(t.Keys) do
  50. if k==io.KeyCode then
  51. t.Function(t.Name,io.UserInputState,io)
  52. end
  53. end
  54. end
  55. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  56. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  57. end
  58. end)
  59. Event.Parent = NLS([==[
  60. local Player = game:GetService("Players").LocalPlayer
  61. local Event = script:WaitForChild("UserInput_Event")
  62.  
  63. local UIS = game:GetService("UserInputService")
  64. local input = function(io,a)
  65. if a then return end
  66. --Since InputObject is a client-side instance, we create and pass table instead
  67. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  68. end
  69. UIS.InputBegan:Connect(input)
  70. UIS.InputEnded:Connect(input)
  71.  
  72. local Mouse = Player:GetMouse()
  73. local h,t
  74. --Give the server mouse data 30 times every second, but only if the values changed
  75. --If player is not moving their mouse, client won't fire events
  76. while wait(1/30) do
  77. if h~=Mouse.Hit or t~=Mouse.Target then
  78. h,t=Mouse.Hit,Mouse.Target
  79. Event:FireServer({isMouse=true,Target=t,Hit=h})
  80. end
  81. end]==],Player.Character)
  82. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  83. end
  84. print("Running")
  85. local cn = CFrame.new
  86. local playersize = 1
  87. local char = owner.Character
  88. local head = char.Head
  89. local torso = char.Torso
  90. local rh = torso["Right Hip"]
  91. local lh = torso["Left Hip"]
  92. local ls = torso["Left Shoulder"]
  93. local rs = torso["Right Shoulder"]
  94. local n = torso["Neck"]
  95. local rarm = char["Right Arm"]
  96. local larm = char["Left Arm"]
  97. local rleg = char["Right Leg"]
  98. local lleg = char["Left Leg"]
  99. local hum = char.Humanoid
  100. local root = char.HumanoidRootPart
  101. local rj = root["RootJoint"]
  102. local cd = false
  103. local bruh = 0
  104. hum:TakeDamage(-math.huge)
  105. hum:TakeDamage(math.huge)
  106. hum.MaxHealth = 2
  107. hum.Health = 2
  108. function refit()
  109. char.Parent = workspace
  110. hum.Parent = workspace
  111. hum.MaxHealth = 2
  112. hum.Health = 2
  113. rh.Parent = torso
  114. lh.Parent = torso
  115. ls.Parent = torso
  116. rs.Parent = torso
  117. n.Parent = torso
  118. rj.Parent = root
  119. rarm.Parent = char
  120. larm.Parent = char
  121. rleg.Parent = char
  122. lleg.Parent = char
  123. root.Parent = char
  124. hum.Parent = char
  125. end
  126. function refit2()
  127. if hum.WalkSpeed ~= 16 or hum.JumpPower ~= 50 then
  128. hum.WalkSpeed = 16
  129. hum.JumpPower = 50
  130. end
  131. if head.Anchored == true or torso.Anchored == true or root.Anchored == true then
  132. head.Anchored = false
  133. root.Anchored = false
  134. torso.Anchored = false
  135. end
  136. if rleg.Anchored == true or lleg.Anchored == true then
  137. rleg.Anchored = false
  138. lleg.Anchored = false
  139. end
  140. if rarm.Anchored == true or larm.Anchored == true then
  141. rarm.Anchored = false
  142. larm.Anchored = false
  143. end
  144. end
  145. refit()
  146. n:GetPropertyChangedSignal("Parent"):Connect(refit)
  147. lh:GetPropertyChangedSignal("Parent"):Connect(refit)
  148. ls:GetPropertyChangedSignal("Parent"):Connect(refit)
  149. rh:GetPropertyChangedSignal("Parent"):Connect(refit)
  150. rs:GetPropertyChangedSignal("Parent"):Connect(refit)
  151. head:GetPropertyChangedSignal("Parent"):Connect(refit)
  152. torso:GetPropertyChangedSignal("Parent"):Connect(refit)
  153. root:GetPropertyChangedSignal("Parent"):Connect(refit)
  154. rj:GetPropertyChangedSignal("Parent"):Connect(refit)
  155. larm:GetPropertyChangedSignal("Parent"):Connect(refit)
  156. lleg:GetPropertyChangedSignal("Parent"):Connect(refit)
  157. rarm:GetPropertyChangedSignal("Parent"):Connect(refit)
  158. rleg:GetPropertyChangedSignal("Parent"):Connect(refit)
  159. hum:GetPropertyChangedSignal("WalkSpeed"):Connect(refit2)
  160. hum:GetPropertyChangedSignal("JumpPower"):Connect(refit2)
  161. hum:GetPropertyChangedSignal("Parent"):Connect(refit)
  162. hum.HealthChanged:Connect(function(newhealth)
  163. if newhealth < hum.MaxHealth and bruh < 40 then
  164. hum.Health = 2
  165. end
  166. end)
  167. hum.HealthChanged:Connect(function(newhealth2)
  168. if newhealth2 < hum.MaxHealth and cd == false and bruh < 40 then
  169. bruh = bruh + 1
  170. cd = true
  171. root.CFrame = root.CFrame * cn(5, 0, 0)
  172. wait(0.5)
  173. root.CFrame = root.CFrame * cn(-5, 0, 0)
  174. wait(0.5)
  175. cd = false
  176. end
  177. end)
Add Comment
Please, Sign In to add comment