Advertisement
duplicat

Untitled

Aug 18th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.26 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. local RealPlayer = Player
  4. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end,__call=function(self,...)local t=rawget(self,"_RealService")if t then return t(...)end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return self[t]end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;x.RunService=v({RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")setmetatable(x,{__index=function(self,t)return r:GetService(t)or typeof(r[t])=="function"and function(m,...)return r[t](r,...)end or r[t]end,__newindex=s.__newindex,__call=s.__call})game,owner=x,x.Players.LocalPlayer end
  5. --size:7128
  6. local plr = game:service'Players'.LocalPlayer
  7. local char = plr.Character
  8. local mouse = plr:GetMouse()
  9. local humanoid = char:findFirstChild("Humanoid")
  10. local torso = char:findFirstChild("Torso")
  11. local head = char.Head
  12. local ra = char:findFirstChild("Right Arm")
  13. local la = char:findFirstChild("Left Arm")
  14. local rl = char:findFirstChild("Right Leg")
  15. local ll = char:findFirstChild("Left Leg")
  16. local rs = torso:findFirstChild("Right Shoulder")
  17. local ls = torso:findFirstChild("Left Shoulder")
  18. local rh = torso:findFirstChild("Right Hip")
  19. local lh = torso:findFirstChild("Left Hip")
  20. local neck = torso:findFirstChild("Neck")
  21. local cam = workspace.CurrentCamera
  22.  
  23.  
  24.  
  25. OVERPowered = false
  26.  
  27. local spear = Instance.new("Model", char)
  28. spear.Name = "Spear"
  29.  
  30. local BG = Instance.new("BodyGyro")
  31. BG.maxTorque = Vector3.new(0, 20e+763, 0)
  32. BG.P = 20e+003
  33. BG.D = 100
  34.  
  35. local handle = Instance.new("Part", spear)
  36. handle.formFactor = "Custom"
  37. handle.Size = Vector3.new(0.2, 0.2, 4)
  38. handle.BrickColor = BrickColor.new("Brown")
  39. handle:BreakJoints()
  40. Instance.new("SpecialMesh", handle).MeshId = "http://www.roblox.com/asset/?id=43645078"
  41. handle.Mesh.Scale = Vector3.new(1.5, 1.5, 1.5)
  42.  
  43. local weld = Instance.new("Weld", handle)
  44. weld.C0 = CFrame.new(0, 0.95, 0) * CFrame.Angles(0, 0, 0)
  45. weld.Part0 = handle
  46. weld.Part1 = ra
  47.  
  48.  
  49. function animate()
  50. BGcframestored = mouse.Hit
  51. BG.Parent = torso
  52. coroutine.wrap(function()
  53. for i = 0, 70, 10 do
  54. neck.C0 = neck.C0 * CFrame.Angles(0, 0, math.rad(10))
  55. BG.cframe = BGcframestored * CFrame.Angles(0, -math.rad(i), 0)
  56. wait()
  57. end
  58. end)()
  59. rs.Parent = nil
  60. local ar = Instance.new("Part", spear)
  61. ar.FormFactor = "Custom"
  62. ar.Size = Vector3.new(1, 1, 1)
  63. ar.Transparency = 1
  64. ar.CanCollide = false
  65. ar.Locked = true
  66. ar:BreakJoints()
  67. local weld = Instance.new("Weld", ar)
  68. weld.C0 = CFrame.new(0, 0.5, 0)
  69. weld.Part0 = ra
  70. weld.Part1 = ar
  71. local motor = Instance.new("Motor", spear)
  72. motor.Part0 = torso
  73. motor.Part1 = ar
  74. motor.C0 = CFrame.new(1.5, 0.5, 0)
  75. for angle = 0, 180, 20 do
  76. motor.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.rad(angle), -math.rad(60), 0)
  77. game:service'RunService'.Stepped:wait()
  78. end
  79.  
  80.  
  81.  
  82.  
  83. coroutine.wrap(function()
  84. for angle = 180, 0, -20 do
  85. motor.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.rad(angle), -math.rad(angle/3), 0)
  86. game:service'RunService'.Stepped:wait()
  87. end
  88. end)()
  89. coroutine.wrap(function()
  90. wait(0.1)
  91. for i = 70, 0, -10 do
  92. neck.C0 = neck.C0 * CFrame.Angles(0, 0, -math.rad(10))
  93. BG.cframe = BGcframestored * CFrame.Angles(0, -math.rad(i), 0)
  94. wait()
  95. end
  96. wait(0.4)
  97. motor:Destroy()
  98. BG.Parent = nil
  99. rs.Parent = torso
  100. ar:Destroy()
  101. end)()
  102. end
  103.  
  104. --billboardGui func
  105.  
  106. function billboardGui(msg, objvar)
  107.  
  108. coroutine.wrap(function()
  109. local prt = Instance.new("Part", char)
  110. prt.FormFactor = "Custom"
  111. prt.Size = Vector3.new(0.1, 0.1, 0.1)
  112. prt.Transparency = 1
  113. prt.CanCollide = false
  114. prt.CFrame = CFrame.new(objvar.CFrame.x, objvar.CFrame.y, objvar.CFrame.z)
  115. prt.Anchored = true
  116.  
  117. local bg = Instance.new("BillboardGui")
  118. bg.Parent = prt
  119. bg.Adornee = prt
  120. bg.Size = UDim2.new(4, 0, 3.5, 0)
  121. bg.ExtentsOffset = Vector3.new(0, 0, 0)
  122. local lol = Instance.new("TextLabel")
  123. lol.Size = UDim2.new(1.3, 0, 0.4, 0)
  124. lol.TextScaled = true
  125. lol.TextWrapped = true
  126. lol.BackgroundTransparency = 1
  127. lol.Parent = bg
  128. lol.FontSize = "Size24"
  129. lol.TextColor3 = Color3.new(1, 0, 0)
  130. lol.TextStrokeTransparency = 0
  131. lol.Font = "ArialBold"
  132. lol.Text = (msg)
  133.  
  134. for _ = 2, 15, 1 do
  135. if prt == nil then return end
  136. prt.CFrame = prt.CFrame * CFrame.new(0, 0.2, 0)
  137. game:service'RunService'.Stepped:wait()
  138. end
  139. for _ = 0, 10 do
  140. lol.TextStrokeTransparency = lol.TextStrokeTransparency + 0.1
  141. lol.TextTransparency = lol.TextTransparency + 0.1
  142. wait()
  143. end
  144.  
  145. prt:Destroy()
  146. end)()
  147. end
  148.  
  149. --ray func
  150.  
  151. function rayCast(speed, gravity)
  152. coroutine.wrap(function()
  153.  
  154.  
  155.  
  156. local rayPart = Instance.new("Part")
  157.  
  158. rayPart.Name = "RayPart"
  159.  
  160. rayPart.BrickColor = BrickColor.new("Brown")
  161.  
  162. rayPart.Anchored = true
  163. rayPart.CanCollide = false
  164. rayPart.Locked = true
  165.  
  166. rayPart.TopSurface = Enum.SurfaceType.Smooth
  167. rayPart.BottomSurface = Enum.SurfaceType.Smooth
  168. rayPart.formFactor = Enum.FormFactor.Custom
  169. rayPart.Size = Vector3.new(0.2, 0.2, 3)
  170. Instance.new("SpecialMesh", rayPart).MeshId = "http://www.roblox.com/asset/?id=43645078"
  171. rayPart.Mesh.Scale = Vector3.new(1.5, 1.5, 1.5)
  172.  
  173.  
  174.  
  175.  
  176.  
  177. local bulletposition = handle.Position + Vector3.new(0, 0, 0)
  178.  
  179. local bulletvelocity = (Vector3.new(math.random(-2,2), math.random(-1,1), math.random(-2,2)))+( plr:GetMouse().Hit.p - bulletposition).unit*speed
  180. local bulletlastposition = bulletposition
  181.  
  182.  
  183.  
  184.  
  185.  
  186. coroutine.resume(coroutine.create(function()
  187. while true do
  188. local dt = wait()
  189. bulletlastposition = bulletposition
  190. bulletvelocity = bulletvelocity + (Vector3.new(0, -9.81*gravity, 0)*dt)
  191. bulletposition = bulletposition + (bulletvelocity*dt)
  192.  
  193. local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition))
  194.  
  195. local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayPart} )
  196.  
  197. if (torso.Position - rayPart.Position).magnitude > 540 then
  198. rayPart:Destroy()
  199. break
  200. end
  201.  
  202.  
  203. if hit then
  204. local damage = math.random(24, 32)
  205. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  206. if OVERPowered then
  207. hit.Parent:BreakJoints()
  208. else
  209. hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
  210. billboardGui("-"..damage, rayPart)
  211. end
  212.  
  213. end
  214.  
  215. if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
  216. if OVERPowered then
  217. hit.Parent.Parent:BreakJoints()
  218. else
  219. hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
  220. billboardGui("-"..damage, rayPart)
  221. end
  222.  
  223.  
  224. if hit.Name == "Tire" and hit ~= nil then
  225. hit:BreakJoints()
  226. end
  227.  
  228. end
  229. bulletposition = hitposition
  230. if hit.Name == "RayPart" then
  231. hit:Destroy()
  232. rayPart:Destroy()
  233. else
  234. wait(5)
  235. rayPart:Destroy()
  236. end
  237. break
  238. end
  239. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) * CFrame.Angles(-math.pi, 0, 0)
  240. rayPart.Parent = workspace
  241. end
  242. end))
  243. end)()
  244. end
  245.  
  246. mouse.Button1Down:connect(function(mouse)
  247. if char.Humanoid.Health == 0 then
  248. return end
  249. if debounce then return end
  250. debounce = true
  251. animate()
  252. rayCast(100, 7)
  253. wait(0.8)
  254. debounce = false
  255. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement