Advertisement
Ban43_GodOfEdits

gil2

Aug 4th, 2018
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.75 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,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  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").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local Mouse = Player:GetMouse()
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  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.  
  85. ----Sandboxed game object that allows the usage of client-side methods and services
  86. --Real game object
  87. local _rg = game
  88.  
  89. --Metatable for fake service
  90. local fsmt = {
  91. __index = function(self,k)
  92. local s = rawget(self,"_RealService")
  93. if s then return s[k] end
  94. end,
  95. __newindex = function(self,k,v)
  96. local s = rawget(self,"_RealService")
  97. if s then s[k]=v end
  98. end,
  99. __call = function(self,...)
  100. local s = rawget(self,"_RealService")
  101. if s then return s(...) end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return self[s]
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. }
  120. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121. g.service = g.GetService
  122.  
  123. g.RunService = FakeService({
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126. self._btrs[name] = self.Heartbeat:Connect(fun)
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132.  
  133. setmetatable(g,{
  134. __index=function(self,s)
  135. return _rg:GetService(s) or typeof(_rg[s])=="function"
  136. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137. end,
  138. __newindex = fsmt.__newindex,
  139. __call = fsmt.__call
  140. })
  141. --Changing owner to fake player object to support owner:GetMouse()
  142. game,owner = g,g.Players.LocalPlayer
  143. end
  144. local num = 0
  145. local p = game.Players.LocalPlayer
  146. local char = p.Character
  147. local rad = math.rad
  148. local hum = char.Humanoid
  149. local Weld0 = Instance.new("Weld")
  150.  
  151. Instance.new("ForceField", char).Visible = false
  152. hum:SetStateEnabled("Dead", false)
  153.  
  154. local candie = false
  155. local Udyne = true
  156. local v3 = Vector3.new
  157.  
  158. local debounce = true
  159. local mouse = p:GetMouse()
  160. local walk1 = true
  161.  
  162. local ns = NumberSequence.new
  163. local new = Instance.new
  164. local nr = NumberRange.new
  165. local bc = BrickColor.new
  166.  
  167. local srot = 0
  168. local spos = {
  169. [1] = {180},
  170. [2] = {144},
  171. [3] = {108},
  172. [4] = {72},
  173. [5] = {36},
  174. [6] = {0}
  175. }
  176. local Vetrom = new("Sound", char)
  177. Vetrom.SoundId = "rbxassetid://"
  178. Vetrom.Volume = 5
  179. Vetrom.Pitch = 1
  180. Vetrom.Looped = true
  181. Vetrom:Play()
  182. local hitsnd = new("Sound", char)
  183. hitsnd.SoundId = "rbxassetid://934916502"
  184. hitsnd.Volume = 10
  185. hitsnd.Pitch = 1
  186.  
  187.  
  188. local udynespear1 = new("Part", char)
  189. udynespear1.BrickColor = bc("Gold")
  190. udynespear1.Material = "Neon"
  191. udynespear1.CanCollide = false
  192. udynespear1.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 10, 0)
  193. udynespear1.Size = Vector3.new(0,0,0)
  194. local udynespear2 = new("Part", char)
  195. udynespear2.BrickColor = udynespear1.BrickColor
  196. udynespear2.Material = udynespear1.Material
  197. udynespear2.CanCollide = false
  198. udynespear2.CFrame = udynespear1.CFrame
  199. udynespear2.Size = udynespear1.Size
  200. local udynespear3 = new("Part", char)
  201. udynespear3.BrickColor = udynespear1.BrickColor
  202. udynespear3.Material = udynespear1.Material
  203. udynespear3.CanCollide = false
  204. udynespear3.CFrame = udynespear1.CFrame
  205. udynespear3.Size = udynespear1.Size
  206. local udynespear4 = new("Part", char)
  207. udynespear4.BrickColor = udynespear1.BrickColor
  208. udynespear4.Material = udynespear1.Material
  209. udynespear4.CanCollide = false
  210. udynespear4.CFrame = udynespear1.CFrame
  211. udynespear4.Size = udynespear1.Size
  212. local udynespear5 = new("Part", char)
  213. udynespear5.BrickColor = udynespear1.BrickColor
  214. udynespear5.Material = udynespear1.Material
  215. udynespear5.CanCollide = false
  216. udynespear5.CFrame = udynespear1.CFrame
  217. udynespear5.Size = udynespear1.Size
  218. local udynespear6 = new("Part", char)
  219. udynespear6.BrickColor = udynespear1.BrickColor
  220. udynespear6.Material = udynespear1.Material
  221. udynespear6.CanCollide = false
  222. udynespear6.CFrame = udynespear1.CFrame
  223. udynespear6.Size = udynespear1.Size
  224.  
  225. local sbg6 = Instance.new("BodyGyro", udynespear6)
  226. sbg6.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  227. sbg6.D = 400
  228. BP6 = Instance.new("BodyPosition", udynespear6)
  229. local sbg5 = Instance.new("BodyGyro", udynespear5)
  230. sbg5.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  231. sbg5.D = 400
  232. BP5 = Instance.new("BodyPosition", udynespear5)
  233. local sbg4 = Instance.new("BodyGyro", udynespear4)
  234. sbg4.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  235. sbg4.D = 400
  236. BP4 = Instance.new("BodyPosition", udynespear4)
  237. local sbg3 = Instance.new("BodyGyro", udynespear3)
  238. sbg3.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  239. sbg3.D = 400
  240. BP3 = Instance.new("BodyPosition", udynespear3)
  241. local sbg2 = Instance.new("BodyGyro", udynespear2)
  242. sbg2.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  243. sbg2.D = 400
  244. BP2 = Instance.new("BodyPosition", udynespear2)
  245. local sbg = Instance.new("BodyGyro", udynespear1)
  246. sbg.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  247. sbg.D = 400
  248. BP = Instance.new("BodyPosition", udynespear1)
  249. spawn(function()
  250. while Udyne == true do
  251.  
  252. sbg6.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
  253. sbg5.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
  254. sbg4.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
  255. sbg3.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
  256. sbg2.CFrame = CFrame.new(udynespear2.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
  257. sbg.CFrame = CFrame.new(udynespear2.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
  258. srot = srot + 4
  259. if srot == 360 then
  260. srot = 0
  261. end
  262. wait()
  263. end
  264. end)
  265. local Light = Instance.new("PointLight", char.HumanoidRootPart)
  266. Light.Color = Color3.new(50, 1, 0)
  267. Light.Brightness = 100
  268. Light.Range = 10
  269. hdebounce = true
  270. function throw1spear()
  271. coroutine.resume(coroutine.create(function()
  272. local udynespeart = new("Part", char)
  273. local zxc = Instance.new("SpecialMesh", udynespeart
  274. )
  275. zxc.MeshType = "FileMesh"
  276. zxc.Scale = Vector3.new(.1,.1,.1)
  277. zxc.MeshId = "rbxassetid://466293216"
  278. zxc.TextureId = "rbxassetid://466293242"
  279. udynespeart.BrickColor = udynespear1.BrickColor
  280. udynespeart.Material = udynespear1.Material
  281. udynespeart.CanCollide = true
  282. udynespeart.Anchored = false
  283. udynespeart.Size = Vector3.new(1.065, 4.969, 0.167)
  284. udynespeart.CFrame = (char.HumanoidRootPart.CFrame + Vector3.new(math.random(1, 2), 0, 2)) * CFrame.fromEulerAnglesXYZ(math.random(0, math.rad(0)), math.random(0, math.rad(0)), math.random(0, math.rad(0)))
  285. udynespeart.Touched:connect(function(hit)
  286. if hit.Parent == char then
  287. return
  288. end
  289. for i, v in pairs(hit.Parent:GetChildren()) do
  290. if v:IsA("Humanoid") and hdebounce == true then
  291. hdebounce = false
  292. v.Health = 0
  293.  
  294. udynespeart.Anchored = true
  295.  
  296. hdebounce = true
  297. end
  298.  
  299. end
  300. end)
  301. local sbgt = Instance.new("BodyGyro", udynespeart)
  302. sbgt.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  303. sbgt.D = 400
  304. sbgt.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
  305. BPt = Instance.new("BodyPosition", udynespeart)
  306. BPt.Position = udynespeart.CFrame * CFrame.new(0, 10, 0).p
  307. wait(1)
  308. udynespeart.Anchored = true
  309. wait(0.5)
  310. udynespeart.Anchored = false
  311. BPt:destroy()
  312. local BodyVelocity = Instance.new("BodyVelocity", udynespeart)
  313. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  314. BodyVelocity.velocity = mouse.Hit.lookVector * 200
  315. for i = 1, 5 do
  316. sbgt.CFrame = CFrame.new(udynespeart.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
  317. wait()
  318. end
  319. sbgt:destroy()
  320. end))
  321. end
  322. mouse.KeyDown:connect(function(k)
  323. if k == "e" then
  324.  
  325. end
  326. end)
  327. z = Instance.new("Sound", char)
  328. z.SoundId = "rbxassetid://168474998" -- Put Music ID Here.
  329. z.Looped = true
  330. z.Volume = 2
  331. wait(.1)
  332. z:Play()
  333. mouse.KeyDown:connect(function(k)
  334. if k == "f" then
  335. throw1spear()
  336. end
  337. end)
  338. local hitt
  339. mouse.KeyDown:connect(function(k)
  340. if k == "q" and mouse.Target then
  341. if mouse.Target.Parent == char then
  342. return
  343. end
  344. if mouse.Target.Parent == game.workspace.Base then
  345. return
  346. end
  347. for i, v in pairs(mouse.Target.Parent:GetChildren()) do
  348. if v:IsA("Humanoid") then
  349. hitt = mouse.Target.Parent
  350. if debounce == true then
  351. debounce = false
  352. for i = 1, 2 do
  353. do
  354. local speara = new("Part", char)
  355. speara.Touched:connect(function(hit)
  356. if hit.Parent == char then
  357. return
  358. end
  359. for i, v in pairs(hit.Parent:GetChildren()) do
  360. if v:IsA("Humanoid") and hdebounce == true then
  361. hdebounce = false
  362. v.Health = v.Health - 10
  363. wait(0.9)
  364. hdebounce = true
  365. end
  366. end
  367. end)
  368. local gunlight = Instance.new("SpotLight", speara)
  369. gunlight.Range = 40
  370. gunlight.Angle = 60
  371. gunlight.Face = "Top"
  372. gunlight.Shadows = true
  373. gunlight.Enabled = true
  374. gunlight.Color = Color3.new(0, 0, 1)
  375. local gunlight2 = Instance.new("SpotLight", speara)
  376. gunlight2.Range = 40
  377. gunlight2.Angle = 60
  378. gunlight2.Face = "Top"
  379. gunlight2.Shadows = true
  380. gunlight2.Enabled = true
  381. gunlight2.Color = Color3.new(0, 0, 1)
  382. speara.Size = Vector3.new(2, 2, 2)
  383. speara.BrickColor = bc("Toothpaste")
  384. local zxc = Instance.new("SpecialMesh", speara)
  385. zxc.MeshType = "FileMesh"
  386. zxc.Scale = Vector3.new(2, 2, 2)
  387. zxc.MeshId = "http://www.roblox.com/asset/?id=69891706"
  388. speara.Transparency = 0
  389. speara.Anchored = false
  390. speara.CanCollide = false
  391. speara.Name = "Spear"
  392. speara.CFrame = (mouse.Hit + Vector3.new(math.random(-10, 10), 19, math.random(-10, 10))) * CFrame.fromEulerAnglesXYZ(math.random(0, math.rad(359)), math.random(0, math.rad(359)), math.random(0, math.rad(359)))
  393. local sbgta = Instance.new("BodyGyro", speara)
  394. sbgta.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  395. sbgta.D = 10
  396. BPta = Instance.new("BodyPosition", speara)
  397. BPta.Name = "shootP"
  398. BPta.P = 20000
  399. sbgta.CFrame = CFrame.new(speara.Position, hitt.HumanoidRootPart.Position) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
  400. BPta.Position = speara.CFrame * CFrame.new(0, 2, 0).p
  401. wait(0.9)
  402. sbgta.D = 500
  403. wait(1)
  404. BPta.D = 1000
  405. BPta.Position = hitt.HumanoidRootPart.CFrame * CFrame.new(0, -3, 0).p
  406. sbgta.CFrame = CFrame.new(speara.Position, hitt.HumanoidRootPart.Position) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
  407. debounce = true
  408. local gdisp = coroutine.wrap(function()
  409. wait(1)
  410. for i = 1, 9 do
  411. wait(0.1)
  412. speara.Transparency = speara.Transparency + 0.3
  413. end
  414. speara:Destroy()
  415. end)
  416. gdisp()
  417. end
  418. end
  419. end
  420. end
  421. end
  422. end
  423. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement