Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.56 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").OwenGaming101
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. endf
  86. wait(0)
  87. local Parts = {
  88. game.Players.OwenGaming101.Character.Torso
  89. }
  90. local w = {}
  91. for i = 2, 24 do
  92. Parts[i] = Instance.new("Part", game.Players.OwenGaming101.Character)
  93. Parts[i].BrickColor = BrickColor.Black()
  94. Parts[i].Material = "Granite"
  95. Parts[i].CanCollide = false
  96. Parts[i].Locked = false
  97. Parts[i].formFactor = "Symmetric"
  98. Parts[i].Size = Vector3.new(1.5, 3, 3)
  99. function onTouched(part)
  100. local h = Parts[i].Parent:findFirstChild("Humanoid")
  101. if h ~= nil then
  102. h.Health = h.Health - 0
  103. wait(0)
  104. end
  105. end
  106. Parts[i].Touched:connect(onTouched)
  107. Mesh = Instance.new("BlockMesh", Parts[i])
  108. Mesh.Name = "Mesh"
  109. if i > 75 then
  110. mult = (i - 25) / 1
  111. else
  112. mult = 0
  113. end
  114. Mesh.Scale = Vector3.new(math.abs(0.5 - (i - 0) / 50) + 0 + mult, 0.3 - (i - 0.15) / 69, 0.6)
  115. w[i - 1] = Instance.new("Weld", Parts[i])
  116. w[i - 1].Part0 = Parts[i - 1]
  117. w[i - 1].Part1 = Parts[i]
  118. w[i - 1].C0 = CFrame.new(0, 0, 0.75)
  119. w[i - 1].C1 = CFrame.new(0, 0, -0.75)
  120. end
  121. w[1].C0 = CFrame.new(0, -0.35, 0)
  122. function Smooth(WhereTo0, Welds)
  123. local CR0 = CFrame.new(Welds[1].C1:toEulerAnglesXYZ()).p
  124. local CR1 = CFrame.new(WhereTo0).p
  125. local AddTo0 = (CR1 - CR0) / 6.9
  126. for a = 1, #Welds do
  127. Welds[a].C1 = Welds[a].C1 * CFrame.fromEulerAnglesXYZ(AddTo0.x, AddTo0.y, AddTo0.z)
  128. end
  129. end
  130. local scr = Instance.new("ScreenGui", game.Players.OwenGaming101.PlayerGui)
  131. local absx = scr.AbsoluteSize.X
  132. local absy = scr.AbsoluteSize.Y
  133. scr:Destroy()
  134. local mouse = game.Players.OwenGaming101:GetMouse()
  135. game:GetService("RunService").RenderStepped:connect(function()
  136. local r = CFrame.new(Vector3.new((mouse.Y - absy / 2) / absy, (mouse.X - absx / 2) / absx, 0.025)).p
  137. local y = r.y
  138. local x = r.x
  139. local z = r.z
  140. Smooth(Vector3.new(y, x, -z), w)
  141. end)
  142. wait(0)
  143. local Parts = {
  144. game.Players.OwenGaming101.Character.Torso
  145. }
  146. local w = {}
  147. for i = 2, 24 do
  148. Parts[i] = Instance.new("Part", game.Players.OwenGaming101.Character)
  149. Parts[i].BrickColor = BrickColor.Black()
  150. Parts[i].Material = "Granite"
  151. Parts[i].CanCollide = false
  152. Parts[i].Locked = false
  153. Parts[i].formFactor = "Symmetric"
  154. Parts[i].Size = Vector3.new(1.1, 0.9, 2.5)
  155. function onTouched(part)
  156. local h = Parts[i].Parent:findFirstChild("Humanoid")
  157. if h ~= nil then
  158. h.Health = h.Health - 0
  159. wait(0)
  160. end
  161. end
  162. Parts[i].Touched:connect(onTouched)
  163. Mesh = Instance.new("BlockMesh", Parts[i])
  164. Mesh.Name = "Mesh"
  165. if i > 75 then
  166. mult = (i - 25) / 1
  167. else
  168. mult = 0
  169. end
  170. Mesh.Scale = Vector3.new(math.abs(0.5 - (i - 0) / 50) + 0 + mult, 0.3 - (i - 0.15) / 99, 0.6)
  171. w[i - 1] = Instance.new("Weld", Parts[i])
  172. w[i - 1].Part0 = Parts[i - 1]
  173. w[i - 1].Part1 = Parts[i]
  174. w[i - 1].C0 = CFrame.new(0, 0, 0.69)
  175. w[i - 1].C1 = CFrame.new(0, 0, -0.69)
  176. end
  177. w[1].C0 = CFrame.new(0, -0.35, 0)
  178. function Smooth(WhereTo0, Welds)
  179. local CR0 = CFrame.new(Welds[1].C1:toEulerAnglesXYZ()).p
  180. local CR1 = CFrame.new(WhereTo0).p
  181. local AddTo0 = (CR1 - CR0) / 6.9
  182. for a = 1, #Welds do
  183. Welds[a].C1 = Welds[a].C1 * CFrame.fromEulerAnglesXYZ(AddTo0.x, AddTo0.y, AddTo0.z)
  184. end
  185. end
  186. local scr = Instance.new("ScreenGui", game.Players.OwenGaming101.PlayerGui)
  187. local absx = scr.AbsoluteSize.X
  188. local absy = scr.AbsoluteSize.Y
  189. scr:Destroy()
  190. local mouse = game.Players.OwenGaming101:GetMouse()
  191. game:GetService("RunService").RenderStepped:connect(function()
  192. local r = CFrame.new(Vector3.new((mouse.Y - absy / 2) / absy, (mouse.X - absx / 2) / absx, 0.025)).p
  193. local y = r.y
  194. local x = r.x
  195. local z = r.z
  196. Smooth(Vector3.new(y, x, -z), w)
  197. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement