Advertisement
voidscriptbuilderr

FE vapor gun script

Jul 20th, 2019
7,205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.20 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  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 V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. me = game.Players.LocalPlayer
  153. walkspeed = 35
  154. walkspeed2 = 16
  155. WaitTime = 0.01
  156. WaitTime2 = 0.41
  157. WaitTime3 = 3
  158. god = false
  159. fakeff = false -- don't enable if god is enabled. it won't break, they both basically god you, but fakeff has a cooler effect.
  160.  
  161. h = Instance.new("HopperBin")
  162. h.Parent = me.Backpack
  163. h.Name = "VaporGun v3"
  164.  
  165. sp = game.Players.LocalPlayer.Backpack["VaporGun v3"]
  166.  
  167.  
  168. rightarm = me.Character["Right Arm"]
  169. leftarm = me.Character["Left Arm"]
  170.  
  171. hold = false
  172. using = false
  173. holdkey = false
  174.  
  175. right = Instance.new("Weld")
  176. right.Parent = me.Character.Torso
  177. right.Part0 = nil
  178. right.Part1 = nil
  179. right.C1 = CFrame.fromEulerAnglesXYZ(-1.57,-0.4,0) * CFrame.new(-1,-0.5,0.1)
  180.  
  181. left = Instance.new("Weld")
  182. left.Parent = me.Character.Torso
  183. left.Part0 = nil
  184. left.Part1 = nil
  185. left.C1 = CFrame.fromEulerAnglesXYZ(-1.4,0.5,0) * CFrame.new(0.55,-0.4,1.3)
  186.  
  187.  
  188. bulletcolors = {"Hot pink", "Really red", "Really blue", "New Yeller", "Lime green", "Neon orange"}
  189.  
  190. gun = Instance.new("Model")
  191. gun.Parent = game.Lighting
  192. gun.Name = "Gun"
  193.  
  194. handle = Instance.new("Part")
  195. handle.Parent = gun
  196. handle.formFactor = 0
  197. handle.Size = Vector3.new(1,1,1)
  198. handle.BrickColor = BrickColor.random()
  199. mesh = Instance.new("SpecialMesh")
  200. mesh.Parent = handle
  201. mesh.MeshType = "Brick"
  202. mesh.Scale = Vector3.new(0.5,0.75,1.6)
  203.  
  204. handle2 = Instance.new("Part")
  205. handle2.Parent = gun
  206. handle2.formFactor = 0
  207. handle2.Size = Vector3.new(1,1,1)
  208. handle2.BrickColor = BrickColor.random()
  209. mesh2 = mesh:clone()
  210. mesh2.Parent = handle2
  211. mesh2.Scale = Vector3.new(0.6,3.6,0.75)
  212.  
  213. handle3 = Instance.new("Part")
  214. handle3.Parent = gun
  215. handle3.formFactor = 0
  216. handle3.Size = Vector3.new(1,1,1)
  217. handle3.BrickColor = BrickColor.random()
  218. mesh3 = mesh:clone()
  219. mesh3.Parent = handle3
  220. mesh3.Scale = Vector3.new(.45,.11,2)
  221.  
  222. handle4 = Instance.new("Part")
  223. handle4.Parent = gun
  224. handle4.formFactor = 0
  225. handle4.Size = Vector3.new(.1,.1,.1)
  226. handle4.BrickColor = BrickColor.random()
  227. mesh4 = Instance.new("CylinderMesh")
  228. mesh4.Parent = handle4
  229. mesh4.Scale = Vector3.new(.4,4,.3)
  230. hold = false
  231.  
  232. if god == true then
  233. me.Character.Humanoid.MaxHealth = math.huge
  234. end
  235. if fakeff == true then
  236. select=Instance.new("SelectionBox",me.Character.Head)
  237. select1=Instance.new("SelectionBox",me.Character.Torso)
  238. select2=Instance.new("SelectionBox",me.Character["Right Arm"])
  239. select3=Instance.new("SelectionBox",me.Character["Left Arm"])
  240. select4=Instance.new("SelectionBox",me.Character["Left Leg"])
  241. select5=Instance.new("SelectionBox",me.Character["Right Leg"])
  242. select.Adornee=me.Character.Head
  243. select1.Adornee=me.Character.Torso
  244. select2.Adornee=me.Character["Right Arm"]
  245. select3.Adornee=me.Character["Left Arm"]
  246. select4.Adornee=me.Character["Left Leg"]
  247. select5.Adornee=me.Character["Right Leg"]
  248. me.Character.Humanoid.MaxHealth=math.huge
  249. end
  250.  
  251. function selected(mouse, key)
  252. right.Part0 = right.Parent
  253. right.Part1 = rightarm
  254. left.Part0 = left.Parent
  255. left.Part1 = leftarm
  256. left.C1 = CFrame.fromEulerAnglesXYZ(-1.4,0.5,0) * CFrame.new(0.55,-0.4,1.3)
  257. right.C1 = CFrame.fromEulerAnglesXYZ(-1.57,-0.4,0) * CFrame.new(-1,-0.5,0.1)
  258. left.C0 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0,0)
  259. right.C0 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0,0)
  260. gun.Parent = me.Character
  261. gunweld1 = Instance.new("Weld")
  262. gunweld1.Parent = rightarm
  263. gunweld1.Part0 = gunweld1.Parent
  264. gunweld1.Part1 = handle
  265. gunweld1.C1 = CFrame.fromEulerAnglesXYZ(0.4,0,0) * CFrame.new(0,1,0)
  266. gunweld2 = Instance.new("Weld")
  267. gunweld2.Parent = handle
  268. gunweld2.Part0 = gunweld2.Parent
  269. gunweld2.Part1 = handle2
  270. gunweld2.C1 = CFrame.fromEulerAnglesXYZ(-0.4,0,0) * CFrame.new(0,1,1.2)
  271. gunweld3 = Instance.new("Weld")
  272. gunweld3.Parent = handle2
  273. gunweld3.Part0 = gunweld3.Parent
  274. gunweld3.Part1 = handle3
  275. gunweld3.C1 = CFrame.fromEulerAnglesXYZ(-0.3,0,0) * CFrame.new(0,0.3,-0.9)
  276. gunweld4 = Instance.new("Weld")
  277. gunweld4.Parent = handle2
  278. gunweld4.Part0 = gunweld3.Parent
  279. gunweld4.Part1 = handle4
  280. gunweld4.C1 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,1.751,0)
  281. mouse.Button1Down:connect(function()
  282. zmeme = Instance.new("Sound",handle4)
  283. zmeme.SoundId = "rbxassetid://479049474"
  284. zmeme.Volume = 100
  285. zmeme.Looped = true
  286. zmeme:Play()
  287. hold = true
  288. while hold == true do
  289. wait(0.04)
  290. local color = math.random(1, #bulletcolors)
  291. local wkspd = walkspeed
  292. local pos = mouse.Hit.p + Vector3.new(math.random(-2,2),0,math.random(-2,2))
  293. local BamOne = Instance.new("Sound",handle4)
  294. BamOne.Pitch,BamOne.Volume,BamOne.SoundId = 1.4,100,"rbxassetid://2920959"
  295. local BamTwo = Instance.new("Sound",handle4)
  296. BamTwo.Pitch,BamTwo.Volume,BamTwo.SoundId = 1.4,100,"rbxassetid://2920959"
  297. local bullet = Instance.new("Part")
  298. bullet.Parent = workspace
  299. bullet.formFactor = 0
  300. bullet.Size = Vector3.new(1,1,1)
  301. bullet.BrickColor = BrickColor.new(bulletcolors[color])
  302. bullet.CanCollide = false
  303. bullet.Anchored = true
  304. bullet.CFrame = CFrame.new((handle4.Position + pos)/2, pos)
  305. local distance = (handle4.Position - pos).magnitude
  306. local bulletmesh = Instance.new("SpecialMesh")
  307. bulletmesh.Parent = bullet
  308. bulletmesh.MeshType = "Brick"
  309. bulletmesh.Scale = Vector3.new(0.2,0.2,distance)
  310. if mouse.Target ~= nil then
  311. local hu = mouse.Target.Parent:findFirstChild("Humanoid")
  312. if hu ~= nil then
  313. hu.Health = hu.Health - 10
  314. if hu.Health == 0 then
  315. vape = Instance.new("Sound",hu.Parent.Head)
  316. vape.SoundId = "rbxassetid://479081073"
  317. vape.Volume = 100
  318. vape:Play()
  319. wait(2.28)
  320. vape:Destroy()
  321. end
  322. end
  323. end
  324. coroutine.resume(coroutine.create(function()
  325. left.C0 = left.C0 * CFrame.fromEulerAnglesXYZ(0.12,0,0)
  326. right.C0 = right.C0 * CFrame.fromEulerAnglesXYZ(0.12,0,0)
  327. wait()
  328. left.C0 = left.C0 * CFrame.fromEulerAnglesXYZ(-0.12,0,0)
  329. right.C0 = right.C0 * CFrame.fromEulerAnglesXYZ(-0.12,0,0)
  330. wait(0.03)
  331. bullet:remove()
  332. end))
  333. end
  334. end)
  335. mouse.Button1Up:connect(function()
  336. zmeme:Pause()
  337. zmeme:Destroy()
  338. hold = false
  339. end)
  340. local Gui = Instance.new("ScreenGui",me.PlayerGui)
  341. Gui.Name = "Ammo"
  342. local Frame = Instance.new("Frame",Gui)
  343. Frame.Name = "MainFrame"
  344. Frame.Size = UDim2.new(.15,0,.1,0)
  345. Frame.Position = UDim2.new(0.4,0,0.4,0)
  346. Frame.BackgroundTransparency = 0.99
  347. Frame.BackgroundColor = BrickColor.new("Really black")
  348. Frame.Active = true
  349. local Exit = Instance.new("TextButton",Gui)
  350. Exit.Name = "Exit"
  351. Exit.Size = UDim2.new(.15,0,.1,0)
  352. Exit.Position = UDim2.new(0.4,0,0.4,0)
  353. Exit.BackgroundTransparency = 1
  354. Exit.Text = ""
  355. Exit.BackgroundColor = BrickColor.new("Really black")
  356. Exit.Active = true
  357. Exit.Draggable = false
  358. Exit.MouseButton1Down:connect(function()
  359. me.PlayerGui["Ammo"]:remove()
  360. end)
  361. local msg1 = "Made by colin, Editted by OpTic Wisdom"
  362. local msg2 = "VaporGun v3"
  363. local msg3 = "Click to exit"
  364. local Cred = Instance.new("TextLabel",Frame)
  365. Cred.Name = "Credz"
  366. Cred.Font = "ArialBold"
  367. Cred.FontSize = "Size12"
  368. Cred.Position = UDim2.new(0.5,0,0.05,0)
  369. for i = 1,#msg1 do
  370. Cred.Text = (string.sub(msg1, 1,i))
  371. wait(WaitTime)
  372. end
  373. Cred.TextColor3 = BrickColor.new("Hot pink").Color
  374. wait(WaitTime2)
  375. local Dis = Instance.new("TextLabel",Frame)
  376. Dis.Name = "Real Numbers"
  377. Dis.Font = "ArialBold"
  378. Dis.FontSize = "Size18"
  379. Dis.Position = UDim2.new(0.5,0,0.5,0)
  380. Dis.TextColor3 = BrickColor.new("Hot pink").Color
  381. for i = 1,#msg2 do
  382. Dis.Text = (string.sub(msg2, 1,i))
  383. wait(WaitTime)
  384. end
  385. me.Character.Humanoid.WalkSpeed = walkspeed
  386. wait(WaitTime3)
  387. for i = 1,#msg2 do
  388. Dis.Text = string.sub(msg2, i,#msg2)
  389. wait(WiatTime)
  390. end
  391. for i = 1,#msg3 do
  392. Dis.Text = (string.sub(msg3, 1,i))
  393. wait(WaitTime)
  394. end
  395. end
  396.  
  397. function deselect()
  398. left.C0 = CFrame.new(0,0,0)
  399. right.C0 = CFrame.new(0,0,0)
  400. me.Character:makeJoints()
  401. wait()
  402. right.Part0 = nil
  403. right.Part1 = nil
  404. left.Part0 = nil
  405. left.Part1 = nil
  406. gun.Parent = game.Lighting
  407. me.Character:makeJoints()
  408. me.PlayerGui["Ammo"]:Remove()
  409. me.Character.Humanoid.WalkSpeed = walkspeed2
  410. end
  411.  
  412. sp.Selected:connect(selected)
  413. sp.Deselected:connect(deselect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement