Advertisement
Godofadmin1337

fe ro-vacuum 2012

Sep 8th, 2018
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.00 KB | None | 0 0
  1.  
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code by Mokiros")
  7. local rp = RealPlayer
  8. script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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(),Button2Up=fakeEvent(),Button2Down=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 then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  52. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68. local Mouse = Player:GetMouse()
  69. local UIS = game:GetService("UserInputService")
  70. local input = function(io,a)
  71. if a then return end
  72. --Since InputObject is a client-side instance, we create and pass table instead
  73. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  74. end
  75. UIS.InputBegan:Connect(input)
  76. UIS.InputEnded:Connect(input)
  77. local h,t
  78. --Give the server mouse data 30 times every second, but only if the values changed
  79. --If player is not moving their mouse, client won't fire events
  80. while wait(1/30) do
  81. if h~=Mouse.Hit or t~=Mouse.Target then
  82. h,t=Mouse.Hit,Mouse.Target
  83. Event:FireServer({isMouse=true,Target=t,Hit=h})
  84. end
  85. end]==],Player.Character)
  86.  
  87. ----Sandboxed game object that allows the usage of client-side methods and services
  88. --Real game object
  89. local _rg = game
  90.  
  91. --Metatable for fake service
  92. local fsmt = {
  93. __index = function(self,k)
  94. local s = rawget(self,"_RealService")
  95. if s then
  96. return typeof(s[k])=="function"
  97. and function(_,...)return s[k](s,...)end or s[k]
  98. end
  99. end,
  100. __newindex = function(self,k,v)
  101. local s = rawget(self,"_RealService")
  102. if s then s[k]=v end
  103. end
  104. }
  105. local function FakeService(t,RealService)
  106. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  107. return setmetatable(t,fsmt)
  108. end
  109.  
  110. --Fake game object
  111. local g = {
  112. GetService = function(self,s)
  113. return rawget(self,s) or _rg:GetService(s)
  114. end,
  115. Players = FakeService({
  116. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  117. },"Players"),
  118. UserInputService = FakeService(UIS,"UserInputService"),
  119. ContextActionService = FakeService(CAS,"ContextActionService"),
  120. RunService = FakeService({
  121. _btrs = {},
  122. RenderStepped = _rg:GetService("RunService").Heartbeat,
  123. BindToRenderStep = function(self,name,_,fun)
  124. self._btrs[name] = self.Heartbeat:Connect(fun)
  125. end,
  126. UnbindFromRenderStep = function(self,name)
  127. self._btrs[name]:Disconnect()
  128. end,
  129. },"RunService")
  130. }
  131. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  132. g.service = g.GetService
  133. FakeService(g,game)
  134. --Changing owner to fake player object to support owner:GetMouse()
  135. game,owner = g,g.Players.LocalPlayer
  136. end
  137.  
  138. function sandbox(var,func)
  139. local env = getfenv(func)
  140. local newenv = setmetatable({},{
  141. __index = function(self,k)
  142. if k=="script" then
  143. return var
  144. else
  145. return env[k]
  146. end
  147. end,
  148. })
  149. setfenv(func,newenv)
  150. return func
  151. end
  152. cors = {}
  153. mas = Instance.new("Model",game:GetService("Lighting"))
  154. Tool0 = Instance.new("Tool")
  155. Script1 = Instance.new("Script")
  156. Part2 = Instance.new("Part")
  157. SpecialMesh3 = Instance.new("SpecialMesh")
  158. Part4 = Instance.new("Part")
  159. SpecialMesh5 = Instance.new("SpecialMesh")
  160. Sound6 = Instance.new("Sound")
  161. Motor7 = Instance.new("Motor")
  162. LocalScript8 = Instance.new("LocalScript")
  163. Tool0.Name = "Vacuum"
  164. Tool0.Parent = mas
  165. Tool0.TextureId = "http://www.roblox.com/asset/?id=84394194 "
  166. Tool0.GripForward = Vector3.new(-0, -2.18556949e-07, -1)
  167. Tool0.GripPos = Vector3.new(-1.5, -0.800000012, -2.70000005)
  168. Tool0.GripRight = Vector3.new(-1, 0, 0)
  169. Tool0.GripUp = Vector3.new(0, -1, 2.18556949e-07)
  170. Script1.Name = "SoundScript"
  171. Script1.Parent = Tool0
  172. table.insert(cors,sandbox(Script1,function()
  173. --Stickmasterluke
  174.  
  175.  
  176. sp=script.Parent
  177. handle=sp.Handle
  178.  
  179.  
  180. script.ChildAdded:connect(function(item)
  181. if item~=nil then
  182. local s=handle:FindFirstChild(item.Name)
  183. if s~=nil then
  184. s:Play()
  185. end
  186. item:remove()
  187. end
  188. end)
  189.  
  190.  
  191. end))
  192. Part2.Name = "Handle"
  193. Part2.Parent = Tool0
  194. Part2.BrickColor = BrickColor.new("White")
  195. Part2.Reflectance = 0.40000000596046
  196. Part2.Rotation = Vector3.new(0, 0, 180)
  197. Part2.Locked = true
  198. Part2.FormFactor = Enum.FormFactor.Custom
  199. Part2.Size = Vector3.new(1.79999995, 2.5, 1)
  200. Part2.CFrame = CFrame.new(-0.100000001, 2.5, 0.5, -1, -0, 0, -0, -1, 0, -0, -0, 1)
  201. Part2.BottomSurface = Enum.SurfaceType.Smooth
  202. Part2.TopSurface = Enum.SurfaceType.Smooth
  203. Part2.Color = Color3.new(0.94902, 0.952941, 0.952941)
  204. Part2.Position = Vector3.new(-0.100000001, 2.5, 0.5)
  205. Part2.Orientation = Vector3.new(0, 0, -180)
  206. Part2.Color = Color3.new(0.94902, 0.952941, 0.952941)
  207. SpecialMesh3.Parent = Part2
  208. SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=84313478 "
  209. SpecialMesh3.Scale = Vector3.new(1.5, 1.5, 1.5)
  210. SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=84313638 "
  211. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  212. SpecialMesh3.Scale = Vector3.new(1.5, 1.5, 1.5)
  213. Part4.Name = "HosePart"
  214. Part4.Parent = Part2
  215. Part4.BrickColor = BrickColor.new("Pastel Blue")
  216. Part4.Rotation = Vector3.new(90, 0, -180)
  217. Part4.Locked = true
  218. Part4.FormFactor = Enum.FormFactor.Custom
  219. Part4.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  220. Part4.CFrame = CFrame.new(1.75909936, 3.53135443, -0.0850819349, -0.999999523, 5.96046235e-08, 0, 0, 5.96046341e-08, -0.999999702, -5.96046164e-08, -0.999999523, -5.96046164e-08)
  221. Part4.Color = Color3.new(0.501961, 0.733333, 0.858824)
  222. Part4.Position = Vector3.new(1.75909936, 3.53135443, -0.0850819349)
  223. Part4.Orientation = Vector3.new(89.9599991, 180, 0)
  224. Part4.Color = Color3.new(0.501961, 0.733333, 0.858824)
  225. SpecialMesh5.Parent = Part4
  226. SpecialMesh5.MeshId = "http://www.roblox.com/asset/?id=84313555 "
  227. SpecialMesh5.Scale = Vector3.new(1.5, 1.5, 1.5)
  228. SpecialMesh5.TextureId = "http://www.roblox.com/asset/?id=84313638 "
  229. SpecialMesh5.MeshType = Enum.MeshType.FileMesh
  230. SpecialMesh5.Scale = Vector3.new(1.5, 1.5, 1.5)
  231. Sound6.Name = "HoseSound"
  232. Sound6.Parent = Part2
  233. Sound6.SoundId = "http://www.roblox.com/asset/?id=81699764"
  234. Sound6.Volume = 0.69999998807907
  235. Motor7.Parent = Part2
  236. Motor7.C0 = CFrame.new(0, 0, 0, -0.999999881, 0, 0, 0, -0.99999994, 0, 0, 0, 0.999999881)
  237. Motor7.C1 = CFrame.new(1.85910034, -0.585082412, 1.0313549, -0.999999642, 0, -5.96046235e-08, 5.96046306e-08, 5.96046377e-08, -0.999999642, 0, -0.999999762, -5.96046235e-08)
  238. Motor7.Part0 = Part2
  239. Motor7.Part1 = Part4
  240. Motor7.MaxVelocity = 0.050000000745058
  241. LocalScript8.Parent = Tool0
  242. table.insert(cors,sandbox(LocalScript8,function()
  243. --Stickmasterluke
  244. --Altered by QuantumSama
  245.  
  246.  
  247. local Tool=script.Parent
  248. local Backpack = Tool.Handle
  249.  
  250. rate=1/30
  251.  
  252. equipped=false
  253. check=true
  254. debris=game:GetService("Debris")
  255.  
  256.  
  257. while Tool.Handle:FindFirstChild("Motor")==nil do
  258. wait()
  259. end
  260. local storeWeld=Tool.Handle.Motor
  261.  
  262. local HoseSound
  263.  
  264.  
  265. function playsound(soundname)
  266. if soundname and Tool:FindFirstChild("SoundScript")~=nil then
  267. local soundtag=Instance.new("StringValue")
  268. soundtag.Name=soundname
  269. soundtag.Parent=Tool.SoundScript
  270. end
  271. end
  272.  
  273. function setwelds()
  274. if storeWeld then
  275. storeWeld.Parent=Tool.Handle
  276. end
  277. if equipped then
  278. local ra=Tool.Parent:FindFirstChild("Right Arm")
  279. local t=Tool.Parent:FindFirstChild("Torso")
  280. if ra~=nil and t~=nil then
  281. local rightgrip=ra:FindFirstChild("RightGrip")
  282. if rightgrip~=nil then
  283. rightgrip.Part0=t
  284. rightgrip.C0=CFrame.new(0,0,1)*CFrame.Angles(0,0,math.pi)
  285. rightgrip.C1=CFrame.new(0,0,0)
  286. end
  287. end
  288. end
  289. end
  290.  
  291. function doSuck()
  292. local plr=game.Players.LocalPlayer
  293. if plr~=nil then
  294. local radiusVec = Vector3.new(6,6,6)
  295. local handle = Tool:FindFirstChild("Handle")
  296. local hose = handle:FindFirstChild("HosePart")
  297. local hoseCFrame = hose.CFrame*CFrame.Angles(math.pi/2,0,0)
  298. local hoseTarget = hoseCFrame + hoseCFrame.lookVector*9
  299. local suckTarget = hoseCFrame + hoseCFrame.lookVector*3
  300. local suckPart = Instance.new("Part")
  301. suckPart.CanCollide = false
  302. suckPart.FormFactor = "Custom"
  303. --suckPart.Shape = "Ball"
  304. suckPart.Size = Vector3.new(.2,.2,.2)
  305. suckPart.CFrame = hoseTarget + Vector3.new((math.random()-.5)*10,(math.random()-.5)*10,(math.random()-.5)*10)
  306. suckPart2 = suckPart:Clone()
  307. suckPart2.CFrame = hoseTarget + Vector3.new((math.random()-.5)*10,(math.random()-.5)*10,(math.random()-.5)*10)
  308. debris:AddItem(suckPart,3)
  309. debris:AddItem(suckPart2,3)
  310. suckPart.Parent = game.Workspace
  311. suckPart2.Parent = game.Workspace
  312.  
  313. local suckRegion = Region3.new(hoseTarget.p - radiusVec, hoseTarget.p + radiusVec)
  314.  
  315. local suckableParts = game.Workspace:FindPartsInRegion3(suckRegion, Tool.Parent,50)
  316.  
  317. local limbChance = .075
  318. for i,v in pairs(suckableParts) do
  319. if v and v.Parent and v:IsA("BasePart") and not v:IsA("Terrain") and v:getMass() < 40 and not v:FindFirstChild("bp") then
  320. local bp = Instance.new("BodyPosition")
  321. bp.Name = "bp"
  322. bp.maxForce = Vector3.new(99999,99999,99999)
  323. bp.D = 3000
  324. bp.P = 30000
  325. bp.position = suckTarget.p
  326. debris:AddItem(bp,.5)
  327. local hum = v.Parent:FindFirstChild("Humanoid")
  328. if hum then
  329. if math.random() < limbChance or hum.Health == 0 then
  330. local creatorTag = Instance.new("ObjectValue")
  331. creatorTag.Value = plr
  332. creatorTag.Name = "creator"
  333. debris:AddItem(creatorTag,.5)
  334. creatorTag.Parent = hum
  335.  
  336. v:BreakJoints()
  337. bp.Parent = v
  338. debris:AddItem(v,.15)
  339. end
  340. else
  341. bp.Parent = v
  342. if not v.Parent:IsA("Tool") then
  343. delay(0,function()
  344. local pos = v.Position
  345. wait(.15)
  346. if (pos-v.Position).magnitude > .1 then
  347. v:Destroy()
  348. end
  349. end)
  350. end
  351. end
  352. end
  353. end
  354. end
  355. end
  356.  
  357. function onEquipped(mouse)
  358. if mouse==nil then
  359. print("Mouse not found")
  360. return
  361. end
  362. equipped=true
  363. mouse.Icon="rbxasset://textures\\GunCursor.png"
  364. mouse.Button1Down:connect(function()
  365. if check and equipped then
  366. check=false
  367. mouse.Icon="rbxasset://textures\\GunWaitCursor.png"
  368. local hum=Tool.Parent:FindFirstChild("Humanoid")
  369. local torso=Tool.Parent:FindFirstChild("Torso")
  370. --local rightArm=Tool.Parent:FindFirstChild("Right Arm")
  371. if torso and hum then
  372. if hum.Health>0 then
  373. HoseSound = Backpack:FindFirstChild("HoseSound")
  374. if HoseSound then HoseSound:Play() end
  375. --theanim:Play()
  376. playsound("Spray")
  377. if storeWeld then
  378. storeWeld.DesiredAngle=-.5
  379. end
  380. local frames = 10
  381. for i = 1, frames do
  382. if not equipped then break end
  383. doSuck()
  384. wait(.2)
  385. end
  386. if storeWeld then
  387. storeWeld.DesiredAngle=0
  388. end
  389. wait(2)
  390. end
  391. end
  392. mouse.Icon="rbxasset://textures\\GunCursor.png"
  393. check=true
  394. end
  395. end)
  396. setwelds()
  397. end
  398.  
  399. function onUnequipped()
  400. equipped=false
  401. if HoseSound then HoseSound:Stop() end
  402. end
  403.  
  404.  
  405. Tool.Equipped:connect(onEquipped)
  406. Tool.Unequipped:connect(onUnequipped)
  407. setwelds()
  408.  
  409.  
  410.  
  411. end))
  412. for i,v in pairs(mas:GetChildren()) do
  413. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  414. pcall(function() v:MakeJoints() end)
  415. end
  416. mas:Destroy()
  417. for i,v in pairs(cors) do
  418. spawn(function()
  419. pcall(v)
  420. end)
  421. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement