Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.69 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")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84. -- Go to line 2 and change it to your name. LOCAL SCRIPT!!!!!
  85. me = owner
  86. if script.Parent.className ~= "HopperBin" then
  87. h = Instance.new("HopperBin",me.Backpack)
  88. h.Name = "LAZOR"
  89. script.Parent = h
  90. end
  91. bin = script.Parent
  92. function prop(part, parent, collide, tran, ref, x, y, z, color)
  93. part.Parent = parent
  94. part.formFactor = 0
  95. part.CanCollide = collide
  96. part.Transparency = tran
  97. part.Reflectance = ref
  98. part.Size = Vector3.new(x,y,z)
  99. part.BrickColor = BrickColor.new(color)
  100. part.TopSurface = 0
  101. part.BottomSurface = 0
  102. part:BreakJoints()
  103. end
  104. function weld(w, p, p0, p1, a, b, c, x, y, z)
  105. w.Parent = p
  106. w.Part0 = p0
  107. w.Part1 = p1
  108. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  109. end
  110. function mesh(mesh, parent, x, y, z, type)
  111. mesh.Parent = parent
  112. mesh.Scale = Vector3.new(x, y, z)
  113. mesh.MeshType = type
  114. end
  115. using = false
  116. sound = Instance.new("Sound",me.Character.Head)
  117. sound.Volume = 0.6
  118. sound.Pitch = 1
  119. sound.SoundId = "rbxasset://sounds/uuhhh.wav"
  120. bin.Selected:connect(function(mouse)
  121. mouse.Button1Down:connect(function()
  122. if using then return end
  123. using = true
  124. local blagh = Instance.new("Model",me.Character)
  125. blagh.Name = "LAZOR"
  126. local paw = mouse.Hit.p
  127. local pa1 = Instance.new("Part")
  128. prop(pa1,blagh,false,0,0,1,1,1,"Really black")
  129. local m1 = Instance.new("SpecialMesh")
  130. mesh(m1, pa1, 1.07,1,0.3,"Brick")
  131. local w1 = Instance.new("Weld")
  132. weld(w1, me.Character.Head, me.Character.Head, pa1, 0.4, 0, 0, 0, -0.4, 0.9)
  133. local pa2 = pa1:clone()
  134. prop(pa2,blagh,false,0,0,1,1,1,"Really black")
  135. local w2 = Instance.new("Weld")
  136. weld(w2, me.Character.Head, me.Character.Head, pa2, -0.4, 0, 0, 0, 0.4, 0.9)
  137. local pa3 = Instance.new("Part")
  138. prop(pa3,blagh,false,0,0,1,1,1,"Really red")
  139. local m3 = Instance.new("SpecialMesh")
  140. mesh(m3,pa3,1.3,1.23,0.29,"Brick")
  141. local w3 = Instance.new("Weld")
  142. weld(w3, me.Character.Head, me.Character.Head, pa3, 0.4, 0, 0, 0, -0.4, 0.9)
  143. local pa4 = pa3:clone()
  144. prop(pa4,blagh,false,0,0,1,1,1,"Really red")
  145. local w4 = Instance.new("Weld")
  146. weld(w4, me.Character.Head, me.Character.Head, pa4, -0.4, 0, 0, 0, 0.4, 0.9)
  147. local eye1a = Instance.new("Part")
  148. prop(eye1a,blagh,false,0,0,1,1,1,"Institutional white")
  149. eye1a.Shape = "Ball"
  150. local emesh1 = Instance.new("SpecialMesh")
  151. mesh(emesh1,eye1a,0.75,0.75,0.75,"Sphere")
  152. local ew = Instance.new("Weld")
  153. weld(ew, me.Character.Head, me.Character.Head, eye1a, 0, 0, 0, 0.45, -1.3, 1.1)
  154. local eye1b = Instance.new("Part")
  155. prop(eye1b,blagh,false,0,0,1,1,1,"Really black")
  156. eye1b.Shape = "Ball"
  157. local emesh1b = Instance.new("SpecialMesh")
  158. mesh(emesh1b,eye1b,0.4,0.4,0.4,"Sphere")
  159. local ew2 = Instance.new("Weld")
  160. weld(ew2, eye1a, eye1a, eye1b, 0, 0, 0, 0.09, -0.04, 0.2)
  161. local eye2a = eye1a:clone()
  162. prop(eye2a,blagh,false,0,0,1,1,1,"Institutional white")
  163. local ew3 = Instance.new("Weld")
  164. weld(ew3, me.Character.Head, me.Character.Head, eye2a, 0, 0, 0, -0.45, -1.3, 1.1)
  165. local eye2b = eye1b:clone()
  166. prop(eye2b,blagh,false,0,0,1,1,1,"Really black")
  167. local ew5 = Instance.new("Weld")
  168. weld(ew5, eye2a, eye2a, eye2b, 0, 0, 0, -0.05, 0.07, 0.2)
  169. local bill = Instance.new("BillboardGui",pa1)
  170. bill.Adornee = bill.Parent
  171. bill.Size = UDim2.new(0,150,0,80)
  172. local txt = Instance.new("TextLabel",bill)
  173. txt.Size = UDim2.new(0,0,0,0)
  174. txt.Position = UDim2.new(0,100,0,-20)
  175. txt.Text = "IMA FIRIN' MAH LAZORR!!"
  176. txt.FontSize = "Size24"
  177. txt.TextColor3 = Color3.new(0,0,0)
  178. sound.Volume = 0.6
  179. for i=1, 5 do
  180. sound.Pitch = math.random(400,900)/1000
  181. sound:play()
  182. wait(0.1)
  183. end
  184. local bg = Instance.new("BodyGyro",me.Character.Torso)
  185. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  186. bg.cframe = CFrame.new(me.Character.Torso.Position, paw)
  187. for i=1, 5 do
  188. sound.Pitch = math.random(400,900)/1000
  189. sound:play()
  190. wait(0.2)
  191. end
  192. txt.Text = "BLAARGHH!!!!!!"
  193. sound.Volume = 0.85
  194. for i=1, 60 do
  195. local dist = (me.Character.Head.Position - paw).magnitude
  196. if dist >= 600 then
  197. dist = 600
  198. end
  199. bg.cframe = CFrame.new(me.Character.Torso.Position, paw)
  200. sound.Pitch = math.random(550,750)/1000
  201. sound:play()
  202. local bewm = Instance.new("Part")
  203. prop(bewm, blagh, false, 0.4, 0.25, 1, 1, dist, "Cyan")
  204. bewm.Anchored = true
  205. local mes = Instance.new("SpecialMesh")
  206. mesh(mes,bewm,1.2,1.2,1,"Brick")
  207. bewm.CFrame = CFrame.new(me.Character.Head.Position, paw) * CFrame.new(0,0,-bewm.Size.Z/2) * CFrame.new(0,0,-1)
  208. local luck = math.random(1,3)
  209. if luck == 1 then
  210. local cfr = Instance.new("Part",blagh)
  211. cfr.Size = Vector3.new(1,1,1)
  212. cfr.Transparency = 1
  213. cfr.Anchored = true
  214. cfr.CFrame = bewm.CFrame * CFrame.new(0,0,-bewm.Size.Z/2)
  215. local ex = Instance.new("Explosion")
  216. ex.Parent = blagh
  217. ex.Position = cfr.Position
  218. ex.BlastRadius = 9
  219. ex.BlastPressure = 400000
  220. ex.Hit:connect(function(part)
  221. if part:GetMass() < 240 then
  222. part.Anchored = false
  223. part:BreakJoints()
  224. end
  225. end)
  226. end
  227. wait()
  228. bewm:remove()
  229. end
  230. blagh:remove()
  231. bg:remove()
  232. using = false
  233. end)
  234. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement