Advertisement
Rocco_T_

Untitled

Aug 4th, 2018
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 51.08 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.  
  6. wait(1)
  7.  
  8. player = owner
  9. char = player.Character
  10. head = char.Head
  11. torso = char.Torso
  12. t = torso
  13. hum = char.Humanoid
  14.  
  15. newWeld = function(wp0, wp1, wc0x, wc0y, wc0z)
  16. local wld = Instance.new("Weld", wp0)
  17. wld.Part0 = wp0
  18. wld.Part1 = wp1
  19. wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
  20. if wp1.Name == "Head" then
  21. wld.Name="Neck"
  22. end
  23. return wld
  24. end
  25.  
  26. for i,v in pairs (char:GetChildren()) do
  27. if v:IsA("Hat") or v:IsA("Accessory") then
  28. v:Destroy()
  29. end
  30. end
  31. Horn = Instance.new("Part")
  32. ParticleEmitter1 = Instance.new("ParticleEmitter")
  33. ParticleEmitter2 = Instance.new("ParticleEmitter")
  34. Horn.Name = "Horns"
  35. Horn.Parent = char
  36. Horn.Size = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  37. Horn.BottomSurface = Enum.SurfaceType.Smooth
  38. Horn.TopSurface = Enum.SurfaceType.Smooth
  39. Horn.CFrame = head.CFrame
  40. ParticleEmitter1.Parent = Horn
  41. ParticleEmitter1.Transparency = NumberSequence.new(1,0.75,1)
  42. ParticleEmitter1.Rotation = NumberRange.new(-180, 180)
  43. ParticleEmitter1.Size = NumberSequence.new(0.8,0)
  44. ParticleEmitter1.LockedToPart=true
  45. ParticleEmitter2.LockedToPart=true
  46. ParticleEmitter1.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
  47. ParticleEmitter1.LightEmission = 0.69999998807907
  48. ParticleEmitter1.Texture = "rbxassetid://170257522"
  49. ParticleEmitter1.EmissionDirection = Enum.NormalId.Left
  50. ParticleEmitter1.ZOffset = 0.5
  51. ParticleEmitter1.Acceleration = Vector3.new(0, 4, 0)
  52. ParticleEmitter1.Lifetime = NumberRange.new(1.1)
  53. ParticleEmitter1.Rate = 100
  54. ParticleEmitter1.RotSpeed = NumberRange.new(-18, 18)
  55. ParticleEmitter1.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
  56.  
  57. ParticleEmitter2.Parent = Horn
  58. ParticleEmitter2.Transparency = NumberSequence.new(1,0.75,1)
  59. ParticleEmitter2.Rotation = NumberRange.new(-180, 180)
  60. ParticleEmitter2.Size = NumberSequence.new(0.8,0)
  61. ParticleEmitter2.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
  62. ParticleEmitter2.LightEmission = 0.69999998807907
  63. ParticleEmitter2.Texture = "rbxassetid://170257522"
  64. ParticleEmitter2.EmissionDirection = Enum.NormalId.Right
  65. ParticleEmitter2.ZOffset = 0.5
  66. ParticleEmitter2.Acceleration = Vector3.new(0, 4, 0)
  67. ParticleEmitter2.Lifetime = NumberRange.new(1.1)
  68. ParticleEmitter2.Rate = 100
  69. ParticleEmitter2.RotSpeed = NumberRange.new(-18, 18)
  70. ParticleEmitter2.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
  71.  
  72.  
  73.  
  74. Hat0 = Instance.new("Accessory")
  75. Handle = Instance.new("Part")
  76. SpecialMesh2 = Instance.new("SpecialMesh")
  77. Hat0.Name = "DarkKnightHood"
  78. Hat0.AttachmentPos = Vector3.new(0, 1.63999999, -0.00999999978)
  79. Handle.Name = "Handle"
  80. Handle.Parent = Hat0
  81. Handle.Rotation = Vector3.new(-13.3299999, -0.25999999, -0.0799999982)
  82. Handle.CanCollide = false
  83. Handle.FormFactor = Enum.FormFactor.Custom
  84. Handle.Size = Vector3.new(2.20000029, 3.80000067, 1.36999905)
  85. Handle.CFrame = CFrame.new(-34.6326752, 7.71574116, 8.64290714, 0.999988198, 0.00145675475, -0.00462479144, -0.000351635739, 0.973076522, 0.23047556, 0.0048360303, -0.230471551, 0.973067045)
  86. Handle.BottomSurface = Enum.SurfaceType.Smooth
  87. Handle.TopSurface = Enum.SurfaceType.Smooth
  88. Handle.Position = Vector3.new(-34.6326752, 7.71574116, 8.64290714)
  89. Handle.Orientation = Vector3.new(-13.3299999, -0.269999981, -0.0199999996)
  90. SpecialMesh0 = Instance.new("SpecialMesh")
  91. SpecialMesh0.Parent = Handle
  92. SpecialMesh0.MeshId = "rbxassetid://391929045"
  93. SpecialMesh0.Offset = Vector3.new(0, 1, 0.25)
  94. SpecialMesh0.Scale = Vector3.new(2.0999999, 2.0999999, 2.0999999)
  95. SpecialMesh0.TextureId = "rbxassetid://391929221"
  96. SpecialMesh0.MeshType = Enum.MeshType.FileMesh
  97. SpecialMesh0.Scale = Vector3.new(2.0999999, 2.0999999, 2.0999999)
  98.  
  99. Accessory0 = Instance.new("Accessory")
  100. Part1 = Instance.new("Part")
  101. SpecialMesh2 = Instance.new("SpecialMesh")
  102. Attachment3 = Instance.new("Attachment")
  103. Vector3Value4 = Instance.new("Vector3Value")
  104. Weld5 = Instance.new("Weld")
  105. Accessory0.Name = "SilverthornAntlers"
  106. Accessory0.AttachmentPos = Vector3.new(0, -0.75, 0.200000003)
  107. H2 = Part1
  108. Part1.Name = "Handle"
  109. Part1.Parent = Accessory0
  110. Part1.Rotation = Vector3.new(-13.3299999, -0.25999999, -0.0799999982)
  111. Part1.CanCollide = false
  112. Part1.Locked = true
  113. Part1.FormFactor = Enum.FormFactor.Plate
  114. Part1.Size = Vector3.new(1, 2, 1)
  115. Part1.CFrame = CFrame.new(-34.6282234, 10.763752, 7.88773584, 0.999988198, 0.00145675475, -0.00462479144, -0.000351635739, 0.973076522, 0.23047556, 0.0048360303, -0.230471551, 0.973067045)
  116. Part1.BottomSurface = Enum.SurfaceType.Smooth
  117. Part1.TopSurface = Enum.SurfaceType.Smooth
  118. Part1.Position = Vector3.new(-34.6282234, 10.763752, 7.88773584)
  119. Part1.Orientation = Vector3.new(-13.3299999, -0.269999981, -0.0199999996)
  120. SpecialMesh2.Parent = Part1
  121. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=1271547"
  122. SpecialMesh2.Scale = Vector3.new(2, 2, 2)
  123. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=9254947"
  124. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  125. SpecialMesh2.Scale = Vector3.new(2, 2, 2)
  126. Attachment3.Name = "HatAttachment"
  127. Attachment3.Parent = Part1
  128. Attachment3.Rotation = Vector3.new(2.37457894e-14, -1.86912034e-22, -4.50996595e-07)
  129. Attachment3.CFrame = CFrame.new(8.65838956e-09, -0.650000095, 0.199727759, 1, 7.87137555e-09, -3.26223034e-24, -7.87137555e-09, 1, -4.1444221e-16, 0, 4.1444221e-16, 1)
  130. Attachment3.Position = Vector3.new(8.65838956e-09, -0.650000095, 0.199727759)
  131. Attachment3.Axis = Vector3.new(1, -7.87137555e-09, 0)
  132. Attachment3.Orientation = Vector3.new(2.37457894e-14, -1.86912034e-22, -4.50996595e-07)
  133. Vector3Value4.Name = "OriginalSize"
  134. Vector3Value4.Parent = Part1
  135. Vector3Value4.Value = Vector3.new(1, 2, 1)
  136.  
  137.  
  138.  
  139. spawn(function()
  140. wait(0.2)
  141. Hat0.Parent=char
  142. -- newWeld(head,Handle,0,0,0)
  143. Accessory0.Parent=char
  144. -- newWeld(head,H2,0,0,0)
  145. end)
  146.  
  147.  
  148.  
  149.  
  150.  
  151. shirt = char:FindFirstChild("Shirt")
  152. pants = char:FindFirstChild("Pants")
  153. sg = char:FindFirstChild("Shirt Graphic")
  154. if shirt then shirt:Destroy() end
  155. if pants then pants:Destroy() end
  156. if sg then sg:Destroy() end
  157.  
  158. shirt = Instance.new("Shirt",char)
  159. pants = Instance.new("Pants",char)
  160.  
  161. shirt.ShirtTemplate = "rbxassetid://767426316"
  162. pants.PantsTemplate = "rbxassetid://201888161"
  163.  
  164. char['Torso'].Size = Vector3.new(4,4,2)
  165.  
  166. char['Right Arm'].Size = Vector3.new(2,4,2)
  167. char['Left Arm'].Size = Vector3.new(2,4,2)
  168. char['Right Leg'].Size = Vector3.new(2,4,2)
  169. char['Left Leg'].Size = Vector3.new(2,4,2)
  170.  
  171. char['Head'].Size = Vector3.new(4,2,2)
  172. local we = Instance.new("Weld",Horn)
  173. we.Part0 = head
  174. we.Part1 = Horn
  175. spawn(function()
  176. local Ang = CFrame.Angles --[Storing these as variables so I dont have to type them out.]
  177. local aSin = math.asin
  178. local aTan = math.atan
  179.  
  180. --[Constants]:
  181.  
  182. local Cam = game.Workspace.CurrentCamera
  183.  
  184. local Plr = game.Players.LocalPlayer
  185. local Mouse = Plr:GetMouse()
  186. local Body = Plr.Character or Plr.CharacterAdded:wait()
  187. local Head = Body:WaitForChild("Head")
  188. local Hum = Body:WaitForChild("Humanoid")
  189. local Core = Body:WaitForChild("HumanoidRootPart")
  190. local IsR6 = (Hum.RigType.Value==0) --[Checking if the player is using R15 or R6.]
  191. local Trso = (IsR6 and Body:WaitForChild("Torso")) or Body:WaitForChild("UpperTorso")
  192. local Neck = (IsR6 and Trso:WaitForChild("Neck")) or Head:WaitForChild("Neck") --[Once we know the Rig, we know what to find.]
  193. local Waist = (not IsR6 and Trso:WaitForChild("Waist")) --[R6 doesn't have a waist joint, unfortunately.]
  194.  
  195. local MseGuide = false
  196.  
  197. local TurnCharacterToMouse = false
  198.  
  199. local HeadHorFactor = 1
  200. local HeadVertFactor = 0.6
  201. local BodyHorFactor = 0.5
  202. local BodyVertFactor = 0.4
  203.  
  204. local UpdateSpeed = 0.5
  205.  
  206. local NeckOrgnC0 = Neck.C0 --[Get the base C0 to manipulate off of.]
  207. local WaistOrgnC0 = (not IsR6 and Waist.C0) --[Get the base C0 to manipulate off of.]
  208.  
  209. --[Setup]:
  210.  
  211.  
  212. -- Activation]:
  213. if TurnCharacterToMouse == true then
  214. MseGuide = true
  215. HeadHorFactor = 0
  216. BodyHorFactor = 0
  217. end
  218.  
  219. game:GetService("RunService").RenderStepped:Connect(function()
  220. local CamCF = Cam.CoordinateFrame
  221. if ((IsR6 and Body["Torso"]) or Body["UpperTorso"])~=nil and Body["Head"]~=nil then --[Check for the Torso and Head...]
  222. local TrsoLV = Trso.CFrame.lookVector
  223. local HdPos = Head.CFrame.p
  224. if IsR6 and Neck or Neck and Waist then --[Make sure the Neck still exists.]
  225. if Cam.CameraSubject:IsDescendantOf(Body) or Cam.CameraSubject:IsDescendantOf(Plr) then
  226. local Dist = nil;
  227. local Diff = nil;
  228. if not MseGuide then --[If not tracking the Mouse then get the Camera.]
  229. Dist = (Head.CFrame.p-CamCF.p).magnitude
  230. Diff = Head.CFrame.Y-CamCF.Y
  231. if not IsR6 then --[R6 and R15 Neck rotation C0s are different; R15: X axis inverted and Z is now the Y.]
  232. Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aSin(Diff/Dist)*HeadVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
  233. Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang((aSin(Diff/Dist)*BodyVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
  234. else --[R15s actually have the properly oriented Neck CFrame.]
  235. Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aSin(Diff/Dist)*HeadVertFactor), 0, -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor),UpdateSpeed/2)
  236. end
  237. else
  238. local Point = Mouse.Hit.p
  239. Dist = (Head.CFrame.p-Point).magnitude
  240. Diff = Head.CFrame.Y-Point.Y
  241. if not IsR6 then
  242. Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aTan(Diff/Dist)*HeadVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
  243. Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang(-(aTan(Diff/Dist)*BodyVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
  244. else
  245. Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aTan(Diff/Dist)*HeadVertFactor), 0, (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor), UpdateSpeed/2)
  246. end
  247. end
  248. end
  249. end
  250. end
  251. if TurnCharacterToMouse == true then
  252. Hum.AutoRotate = false
  253. Core.CFrame = Core.CFrame:lerp(CFrame.new(Core.Position, Vector3.new(Mouse.Hit.p.x, Core.Position.Y, Mouse.Hit.p.z)), UpdateSpeed / 2)
  254. else
  255. Hum.AutoRotate = true
  256. end
  257. end)
  258. end)
  259.  
  260.  
  261. larm = char['Left Arm']
  262. rarm = char['Right Arm']
  263. lleg = char['Left Leg']
  264. rleg = char['Right Leg']
  265. hed = char['Head']
  266. root = char['HumanoidRootPart']
  267.  
  268. LeftArm = newWeld(torso, larm, -1.5, 1, 0)
  269.  
  270. RightArm = newWeld(torso, rarm, 1.5, 1, 0)
  271.  
  272. Head = newWeld(torso, hed, 0, 3, 0)
  273.  
  274. LeftLeg = newWeld(torso, lleg, -1, -2, 0)
  275.  
  276. RightLeg = newWeld(torso, rleg, 1, -2, 0)
  277.  
  278. Torso = newWeld(root, torso, 0, -2, 0)
  279.  
  280. Torso.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  281. Torso.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  282. LeftLeg.C0 = CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  283. LeftLeg.C1 = CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  284. RightLeg.C0 = CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  285. RightLeg.C1 = CFrame.new(0.5, 1, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  286. LeftArm.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  287. LeftArm.C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  288. RightArm.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  289. RightArm.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  290. Head.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  291. Head.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  292.  
  293. function createSound(id,speed,vol,looped,parent)
  294. local sound = Instance.new("Sound",head)
  295. sound.SoundId = id
  296. sound.PlaybackSpeed = speed
  297. if parent then sound.Parent = parent end
  298. if vol then sound.Volume = vol end
  299. if looped then sound.Looped = looped end
  300. sound:Play()
  301. spawn(function()
  302. if looped == false then
  303. wait(sound.TimeLength)
  304. sound:Destroy()
  305. end
  306. end)
  307. end
  308. --BGM
  309. createSound('rbxassetid://1337508713',1,1,true)
  310.  
  311. --Delete the animator
  312. humanoid = char:FindFirstChildOfClass("Humanoid")
  313.  
  314. do
  315. char:WaitForChild("Animate"):Destroy()
  316. humanoid:WaitForChild("Animator"):Destroy()
  317. end
  318.  
  319. pose = "Idle"
  320.  
  321. --Pose updater
  322. spawn(function()
  323. while wait() do
  324. local velocity = char.HumanoidRootPart.Velocity
  325. local X = (char.HumanoidRootPart.Velocity).magnitude
  326. local vY = velocity.Y
  327. if vY > 0.8 then
  328. pose = "Jumping"
  329. elseif vY<-0.8 then
  330. pose = "Falling"
  331. end
  332. if X > 0.8 then
  333. pose = "Running"
  334. end
  335. if humanoid.MoveDirection == Vector3.new(0,0,0) then
  336. pose = "Idle"
  337. end
  338. if X < 0.3 and vY < 0.3 and X > -0.3 and vY > -0.3 then
  339. pose = "Idle"
  340. end
  341. end
  342. end)
  343.  
  344. --Spell hand
  345. Spells = Instance.new("Model")
  346. Part1 = Instance.new("Part")
  347. SurfaceGui2 = Instance.new("SurfaceGui")
  348. ImageLabel3 = Instance.new("ImageLabel")
  349. SurfaceGui4 = Instance.new("SurfaceGui")
  350. ImageLabel5 = Instance.new("ImageLabel")
  351. SurfaceGui6 = Instance.new("SurfaceGui")
  352. ImageLabel7 = Instance.new("ImageLabel")
  353. SurfaceGui8 = Instance.new("SurfaceGui")
  354. ImageLabel9 = Instance.new("ImageLabel")
  355. Weld10 = Instance.new("Weld")
  356. Part11 = Instance.new("Part")
  357. SurfaceGui12 = Instance.new("SurfaceGui")
  358. ImageLabel13 = Instance.new("ImageLabel")
  359. SurfaceGui14 = Instance.new("SurfaceGui")
  360. ImageLabel15 = Instance.new("ImageLabel")
  361. SurfaceGui16 = Instance.new("SurfaceGui")
  362. ImageLabel17 = Instance.new("ImageLabel")
  363. SurfaceGui18 = Instance.new("SurfaceGui")
  364. ImageLabel19 = Instance.new("ImageLabel")
  365. Weld20 = Instance.new("Weld")
  366. Part21 = Instance.new("Part")
  367. SurfaceGui22 = Instance.new("SurfaceGui")
  368. ImageLabel23 = Instance.new("ImageLabel")
  369. SurfaceGui24 = Instance.new("SurfaceGui")
  370. ImageLabel25 = Instance.new("ImageLabel")
  371. SurfaceGui26 = Instance.new("SurfaceGui")
  372. ImageLabel27 = Instance.new("ImageLabel")
  373. SurfaceGui28 = Instance.new("SurfaceGui")
  374. ImageLabel29 = Instance.new("ImageLabel")
  375. Weld30 = Instance.new("Weld")
  376. Part31 = Instance.new("Part")
  377. Weld32 = Instance.new("Weld")
  378. Spells.Name = "Spells"
  379. Spells.Parent = mas
  380. Spells.PrimaryPart = Part31
  381. Part1.Name = "Spell3"
  382. Part1.Parent = Spells
  383. Part1.Transparency = 1
  384. Part1.Size = Vector3.new(3, 0.0500000007, 3)
  385. Part1.CFrame = CFrame.new(-2.00700021, 1.75291348, 1.921, 1, 0, 0, 0, 0.999999642, 0, 0, 0, 1)
  386. Part1.BottomSurface = Enum.SurfaceType.Smooth
  387. Part1.TopSurface = Enum.SurfaceType.Smooth
  388. Part1.Position = Vector3.new(-2.00700021, 1.75291348, 1.921)
  389. SurfaceGui2.Parent = Part1
  390. SurfaceGui2.Face = Enum.NormalId.Top
  391. ImageLabel3.Parent = SurfaceGui2
  392. ImageLabel3.Transparency = 1
  393. ImageLabel3.Size = UDim2.new(1, 0, 1, 0)
  394. ImageLabel3.BackgroundColor3 = Color3.new(1, 1, 1)
  395. ImageLabel3.BackgroundTransparency = 1
  396. ImageLabel3.Image = "rbxassetid://3337202"
  397. SurfaceGui4.Parent = Part1
  398. SurfaceGui4.Face = Enum.NormalId.Top
  399. ImageLabel5.Parent = SurfaceGui4
  400. ImageLabel5.Transparency = 1
  401. ImageLabel5.Size = UDim2.new(1, 0, 1, 0)
  402. ImageLabel5.BackgroundColor3 = Color3.new(1, 1, 1)
  403. ImageLabel5.BackgroundTransparency = 1
  404. ImageLabel5.Image = "rbxassetid://3337202"
  405. SurfaceGui6.Parent = Part1
  406. SurfaceGui6.Face = Enum.NormalId.Bottom
  407. ImageLabel7.Parent = SurfaceGui6
  408. ImageLabel7.Transparency = 1
  409. ImageLabel7.Size = UDim2.new(1, 0, 1, 0)
  410. ImageLabel7.BackgroundColor3 = Color3.new(1, 1, 1)
  411. ImageLabel7.BackgroundTransparency = 1
  412. ImageLabel7.Image = "rbxassetid://3337202"
  413. SurfaceGui8.Parent = Part1
  414. SurfaceGui8.Face = Enum.NormalId.Bottom
  415. ImageLabel9.Parent = SurfaceGui8
  416. ImageLabel9.Transparency = 1
  417. ImageLabel9.Size = UDim2.new(1, 0, 1, 0)
  418. ImageLabel9.BackgroundColor3 = Color3.new(1, 1, 1)
  419. ImageLabel9.BackgroundTransparency = 1
  420. ImageLabel9.Image = "rbxassetid://3337202"
  421. Weld10.Name = "SpellWeld"
  422. Weld10.Parent = Part1
  423. Weld10.C1 = CFrame.new(0.000245000236, 1.24710596, -0.00010599941, 1, 0, 0, 0, 0.999999762, 0, 0, 0, 1)
  424. Weld10.Part0 = Part31
  425. Weld10.Part1 = Part1
  426. Part11.Name = "Spell1"
  427. Part11.Parent = Spells
  428. Part11.Transparency = 1
  429. Part11.Shape = Enum.PartType.Cylinder
  430. Part11.Size = Vector3.new(3.5, 0.0500000007, 3.5)
  431. Part11.CFrame = CFrame.new(-2.00700021, 3.00000024, 1.921, 1, 0, 0, 0, 0.999999404, 0, 0, 0, 1)
  432. Part11.BottomSurface = Enum.SurfaceType.Smooth
  433. Part11.TopSurface = Enum.SurfaceType.Smooth
  434. Part11.Position = Vector3.new(-2.00700021, 3.00000024, 1.921)
  435. SurfaceGui12.Parent = Part11
  436. SurfaceGui12.Face = Enum.NormalId.Top
  437. ImageLabel13.Parent = SurfaceGui12
  438. ImageLabel13.Transparency = 1
  439. ImageLabel13.Size = UDim2.new(1, 0, 1, 0)
  440. ImageLabel13.BackgroundColor3 = Color3.new(1, 1, 1)
  441. ImageLabel13.BackgroundTransparency = 1
  442. ImageLabel13.Image = "rbxassetid://3337202"
  443. SurfaceGui14.Parent = Part11
  444. SurfaceGui14.Face = Enum.NormalId.Top
  445. ImageLabel15.Parent = SurfaceGui14
  446. ImageLabel15.Transparency = 1
  447. ImageLabel15.Size = UDim2.new(1, 0, 1, 0)
  448. ImageLabel15.BackgroundColor3 = Color3.new(1, 1, 1)
  449. ImageLabel15.BackgroundTransparency = 1
  450. ImageLabel15.Image = "rbxassetid://3337202"
  451. SurfaceGui16.Parent = Part11
  452. SurfaceGui16.Face = Enum.NormalId.Bottom
  453. ImageLabel17.Parent = SurfaceGui16
  454. ImageLabel17.Transparency = 1
  455. ImageLabel17.Size = UDim2.new(1, 0, 1, 0)
  456. ImageLabel17.BackgroundColor3 = Color3.new(1, 1, 1)
  457. ImageLabel17.BackgroundTransparency = 1
  458. ImageLabel17.Image = "rbxassetid://3337202"
  459. SurfaceGui18.Parent = Part11
  460. SurfaceGui18.Face = Enum.NormalId.Bottom
  461. ImageLabel19.Parent = SurfaceGui18
  462. ImageLabel19.Transparency = 1
  463. ImageLabel19.Size = UDim2.new(1, 0, 1, 0)
  464. ImageLabel19.BackgroundColor3 = Color3.new(1, 1, 1)
  465. ImageLabel19.BackgroundTransparency = 1
  466. ImageLabel19.Image = "rbxassetid://3337202"
  467. Weld20.Name = "SpellWeld"
  468. Weld20.Parent = Part11
  469. Weld20.C1 = CFrame.new(0.000245000236, 1.88350677e-05, -0.00010599941, 1, 0, 0, 0, 0.999999523, 0, 0, 0, 1)
  470. Weld20.Part0 = Part31
  471. Weld20.Part1 = Part11
  472. Part21.Name = "Spell2"
  473. Part21.Parent = Spells
  474. Part21.Transparency = 1
  475. Part21.Size = Vector3.new(3.25, 0.0500000007, 3.25)
  476. Part21.CFrame = CFrame.new(-2.00700021, 2.32607484, 1.921, 1, 0, 0, 0, 0.999999166, 0, 0, 0, 1)
  477. Part21.BottomSurface = Enum.SurfaceType.Smooth
  478. Part21.TopSurface = Enum.SurfaceType.Smooth
  479. Part21.Position = Vector3.new(-2.00700021, 2.32607484, 1.921)
  480. SurfaceGui22.Parent = Part21
  481. SurfaceGui22.Face = Enum.NormalId.Top
  482. ImageLabel23.Parent = SurfaceGui22
  483. ImageLabel23.Transparency = 1
  484. ImageLabel23.Size = UDim2.new(1, 0, 1, 0)
  485. ImageLabel23.BackgroundColor3 = Color3.new(1, 1, 1)
  486. ImageLabel23.BackgroundTransparency = 1
  487. ImageLabel23.Image = "rbxassetid://3337202"
  488. SurfaceGui24.Parent = Part21
  489. SurfaceGui24.Face = Enum.NormalId.Top
  490. ImageLabel25.Parent = SurfaceGui24
  491. ImageLabel25.Transparency = 1
  492. ImageLabel25.Size = UDim2.new(1, 0, 1, 0)
  493. ImageLabel25.BackgroundColor3 = Color3.new(1, 1, 1)
  494. ImageLabel25.BackgroundTransparency = 1
  495. ImageLabel25.Image = "rbxassetid://3337202"
  496. SurfaceGui26.Parent = Part21
  497. SurfaceGui26.Face = Enum.NormalId.Bottom
  498. ImageLabel27.Parent = SurfaceGui26
  499. ImageLabel27.Transparency = 1
  500. ImageLabel27.Size = UDim2.new(1, 0, 1, 0)
  501. ImageLabel27.BackgroundColor3 = Color3.new(1, 1, 1)
  502. ImageLabel27.BackgroundTransparency = 1
  503. ImageLabel27.Image = "rbxassetid://3337202"
  504. SurfaceGui28.Parent = Part21
  505. SurfaceGui28.Face = Enum.NormalId.Bottom
  506. ImageLabel29.Parent = SurfaceGui28
  507. ImageLabel29.Transparency = 1
  508. ImageLabel29.Size = UDim2.new(1, 0, 1, 0)
  509. ImageLabel29.BackgroundColor3 = Color3.new(1, 1, 1)
  510. ImageLabel29.BackgroundTransparency = 1
  511. ImageLabel29.Image = "rbxassetid://3337202"
  512. Weld30.Name = "SpellWeld"
  513. Weld30.Parent = Part21
  514. Weld30.C1 = CFrame.new(0.000245000236, 0.673944712, -0.00010599941, 1, 0, 0, 0, 0.999999285, 0, 0, 0, 1)
  515. Weld30.Part0 = Part31
  516. Weld30.Part1 = Part21
  517. Part31.Name = "Handle"
  518. Part31.Parent = Spells
  519. Part31.Transparency = 1
  520. Part31.Size = Vector3.new(2, 4, 2)
  521. Part31.CFrame = CFrame.new(-2.00675511, 3.00001907, 1.92089403, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
  522. Part31.BottomSurface = Enum.SurfaceType.Smooth
  523. Part31.TopSurface = Enum.SurfaceType.Smooth
  524. Part31.Position = Vector3.new(-2.00675511, 3.00001907, 1.92089403)
  525. Weld32.Parent = Part31
  526. Weld32.Part0 = Part31
  527. Weld32.Part1 = char['Right Arm']
  528.  
  529. Spells.Parent = char
  530.  
  531. spawn(function()
  532. while wait() do
  533. Spells.Spell1.SpellWeld.C0 = Spells.Spell1.SpellWeld.C0*CFrame.Angles(0,math.rad(2),0)
  534. Spells.Spell2.SpellWeld.C0 = Spells.Spell2.SpellWeld.C0*CFrame.Angles(0,math.rad(-1.5),0)
  535. Spells.Spell3.SpellWeld.C0 = Spells.Spell3.SpellWeld.C0*CFrame.Angles(0,math.rad(1),0)
  536. end
  537. end)
  538.  
  539. for i,v in pairs (Spells:GetChildren()) do
  540. v.Anchored=false
  541. end
  542.  
  543. function swait()
  544. game:GetService("RunService").RenderStepped:Wait(0)
  545. end
  546.  
  547. --Animator
  548. movearms = true
  549. movebody = true
  550. movelegs = true
  551. spawn(function()
  552. --Other
  553. while wait() do
  554. if pose == "Idle" and movebody==true and movearms==true then
  555. for i=0,0.1, 0.001333 do
  556. if pose~="Idle" or movebody~=true or movearms~=true then break end
  557. swait()
  558. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.92139721, 0.609127104, 0.197871476, -0.13787961, -0.0786464438, -0.987321615, -3.47089579e-09, 0.996842444, -0.0794048384, 0.990449011, -0.010948305, -0.137444243),i)
  559. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-2.20093918, 0.755841017, -0.380287111, 0.168671146, 0.18313548, 0.968509912, 0.148882583, 0.966580868, -0.20869942, -0.974363387, 0.179395825, 0.135768622),i)
  560. end
  561. for i=0,0.1, 0.001333 do
  562. if pose~="Idle" or movebody~=true or movearms~=true then break end
  563. swait()
  564. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.93793058, 0.525867939, 0.0558444038, -0.0389509574, -0.0212362912, -0.99901545, 0.00805827603, 0.999734938, -0.0215657726, 0.999208629, -0.00889034942, -0.0387694985),i)
  565. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-2.12205648, 0.581189692, -0.428195477, 0.182427317, 0.100968368, 0.978021324, 0.136899486, 0.982415557, -0.126957461, -0.973642051, 0.157051116, 0.165396914),i)
  566. end
  567. end
  568. if pose == "Running" and movebody==true and movelegs==true then
  569. for i=0,0.07, 0.0006 do
  570. if pose~="Running" or movebody~=true or movelegs~=true then break end
  571. swait()
  572. LeftLeg.C1 = LeftLeg.C1:lerp(CFrame.new(-0.15999198, 2.24705672, 0.864792287, -0.025055496, -0.0938593671, -0.995270133, -0.146920413, 0.985117793, -0.0892032757, 0.988830924, 0.143990457, -0.0384724736),i)
  573. RightLeg.C1 = RightLeg.C1:lerp(CFrame.new(0.113590628, 2.78344774, 0.198696569, -4.3675584e-08, 0.0404659845, 0.999180913, 0.199607119, 0.979073405, -0.0396516435, -0.979876041, 0.199443609, -0.00807734113),i)
  574. end
  575. for i=0,0.07, 0.0006 do
  576. if pose~="Running" or movebody~=true or movelegs~=true then break end
  577. swait()
  578. LeftLeg.C1 = LeftLeg.C1:lerp(CFrame.new(-0.217573136, 2.06966305, 0.864792287, -0.0282963123, -0.0720653757, -0.996998429, -0.146330804, 0.98695153, -0.067186065, 0.988830924, 0.143990457, -0.0384724736),i)
  579. RightLeg.C1 = RightLeg.C1:lerp(CFrame.new(0.113590628, 2.79427099, 0.02752655, -4.3675584e-08, 0.0404659845, 0.999180913, 0.105148442, 0.993641973, -0.0402416587, -0.99445653, 0.105062313, -0.00425497862),i)
  580. end
  581. end
  582. end
  583.  
  584.  
  585. end)
  586.  
  587. spawn(function()
  588. --Other
  589. while wait() do
  590. if pose == "Idle" and movebody==true and movelegs==true then
  591. for i=0,0.08, 0.0005677 do
  592. if pose~="Idle" or movebody~=true or movelegs~=true then break end
  593. swait()
  594. LeftLeg.C1 = LeftLeg.C1:lerp(CFrame.new(-0.208144277, 1.99190795, 0.413949221, -0.0282963067, -0.0720653683, -0.996998429, 0.117742933, 0.990214169, -0.0749167055, 0.992640853, -0.119509391, -0.0195342172),i)
  595. RightLeg.C1 = RightLeg.C1:lerp(CFrame.new(0.0902807415, 2.19053221, 0.0564393736, 0.00101210177, 0.0393193997, 0.999226153, 0.116191842, 0.992454112, -0.0391706079, -0.99322629, 0.116141573, -0.00356412865),i)
  596. end
  597. for i=0,0.08, 0.0005677 do
  598. if pose~="Idle" or movebody~=true or movelegs~=true then break end
  599. swait()
  600. LeftLeg.C1 = LeftLeg.C1:lerp(CFrame.new(-0.208144277, 2.21289301, 0.413949221, -0.0282963067, -0.0720653683, -0.996998429, 0.117742933, 0.990214169, -0.0749167055, 0.992640853, -0.119509391, -0.0195342172),i)
  601. RightLeg.C1 = RightLeg.C1:lerp(CFrame.new(0.0902807415, 2.26938629, 0.0564393736, 0.00101210177, 0.0393193997, 0.999226153, 0.116191842, 0.992454112, -0.0391706079, -0.99322629, 0.116141573, -0.00356412865),i)
  602. end
  603. end
  604.  
  605. if pose == "Running" and movearms==true and movebody==true then
  606. for i=0,0.063, 0.0006 do
  607. if pose~="Running" or movebody~=true or movearms~=true then break end
  608. swait()
  609. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.9257164, 0.677200794, -0.159240723, -0.144065306, -0.151931494, -0.977835357, -0.256799757, 0.960030913, -0.111330599, 0.95566684, 0.235069022, -0.177323118),i)
  610. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-2.01159811, 0.541409969, -0.189548492, -0.114454262, 0.11331255, 0.986945033, 0.151508436, 0.98384279, -0.0953862146, -0.981807232, 0.138613135, -0.129772812),i)
  611. end
  612. for i=0,0.063, 0.0006 do
  613. if pose~="Running" or movebody~=true or movearms~=true then break end
  614. swait()
  615. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.92266786, 0.692670405, -0.0514299348, -0.133117691, -0.157718673, -0.978470564, -0.06509877, 0.986516297, -0.150159091, 0.988959908, 0.0437084138, -0.141590059),i)
  616. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-2.01004601, 0.580142736, 0.045785062, -0.10774301, 0.123860687, 0.986433089, 0.0519879125, 0.991553247, -0.118825234, -0.992818654, 0.0384800434, -0.113272227),i)
  617. end
  618. end
  619. end
  620. end)
  621.  
  622. spawn(function()
  623. while wait() do
  624. --MAINBODY
  625. if pose == "Idle" and movebody==true then
  626. for i=0,0.08, 0.0008 do
  627. if pose~="Idle" or movebody~=true then break end
  628. swait()
  629. Torso.C1 = Torso.C1:lerp(CFrame.new(-0.0568120815, -1.76807761, -0.325204164, -0.993514419, -0.109230503, 0.0315862447, 0.0506483465, -0.176418021, 0.983011425, -0.101802446, 0.978235841, 0.180806205),i)
  630. Head.C1 = Head.C1:lerp(CFrame.new(0.0760571063, -1.96275795, -0.0808709711, -0.992963433, 0.106468454, -0.0518465824, -0.0573577061, -0.0493686944, 0.997132301, 0.103603534, 0.993089736, 0.0551280938),i)
  631. end
  632. for i=0,0.08, 0.0008 do
  633. if pose~="Idle" or movebody~=true then break end
  634. swait()
  635. Torso.C1 = Torso.C1:lerp(CFrame.new(-0.050637722, -1.57592607, -0.289861679, -0.993514478, -0.109230503, 0.0315862447, 0.0506483503, -0.176418021, 0.983011425, -0.101802453, 0.978235841, 0.180806205),i)
  636. Head.C1 = Head.C1:lerp(CFrame.new(0.0760571063, -1.96275795, -0.0808709711, -0.992963433, 0.106468454, -0.0518465824, -0.0573577061, -0.0493686944, 0.997132301, 0.103603534, 0.993089736, 0.0551280938),i)
  637. end
  638. end
  639. if pose == "Running" and movebody == true then
  640. for i=0,0.08, 0.0008 do
  641. if pose~="Running" or movebody~=true then break end
  642. swait()
  643. Torso.C1 = Torso.C1:lerp(CFrame.new(-0.00214004517, -1.89437246, -0.72511673, -0.998660922, 0.0516983718, 0.0019045159, -0.0175054725, -0.372338474, 0.927931905, 0.0486816913, 0.926656008, 0.372744888),i)
  644. Head.C1 = Head.C1:lerp(CFrame.new(-0.0691558272, -1.96407938, 0.0606224984, -0.99810046, -0.0396612808, 0.0471421182, 0.0454219505, 0.043208681, 0.998033047, -0.0416202173, 0.998278499, -0.0413251184),i)
  645. end
  646. for i=0,0.08, 0.0008 do
  647. if pose~="Running" or movebody~=true then break end
  648. swait()
  649. Torso.C1 = Torso.C1:lerp(CFrame.new(-0.00342551619, -1.66900969, -0.670431733, -0.998660862, 0.0516983755, 0.00190451648, -0.0175054707, -0.372338533, 0.927931905, 0.0486816876, 0.926655948, 0.372744948),i)
  650. Head.C1 = Head.C1:lerp(CFrame.new(-0.0691558272, -1.96407938, 0.0606224984, -0.99810046, -0.0396612808, 0.0471421182, 0.0454219505, 0.043208681, 0.998033047, -0.0416202173, 0.998278499, -0.0413251184),i)
  651. end
  652. end
  653. end
  654. end)
  655.  
  656. --Attack
  657. mouse = player:GetMouse()
  658. attacking = false
  659. righthand = false
  660. righting = false
  661. lefting = false
  662.  
  663.  
  664.  
  665. function lazor()
  666. attacking = true
  667. movebody = false
  668. for i=0,0.13, 0.0013 do
  669. Torso.C1 = Torso.C1:lerp(CFrame.new(0.15688242, -1.76807761, -0.290470749, -0.716801167, -0.691800654, -0.0872230977, 0.0506483465, -0.176418021, 0.983011425, -0.695435643, 0.700206041, 0.161495224),i)
  670. LeftLeg.C1 = LeftLeg.C1:lerp(CFrame.new(-0.0380690396, 2.68862104, 0.427225471, -0.0158015247, 0.0321018472, -0.999359608, 0.120059952, 0.992313921, 0.029977167, 0.992640913, -0.119509406, -0.0195342209),i)
  671. RightLeg.C1 = RightLeg.C1:lerp(CFrame.new(0.113590628, 2.79427099, 0.02752655, -4.3675584e-08, 0.0404659845, 0.999180913, 0.105148442, 0.993641973, -0.0402416587, -0.99445653, 0.105062313, -0.00425497862),i)
  672. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.92139709, 0.609127104, 0.197871447, -0.13787961, -0.0786464438, -0.987321615, -3.47089579e-09, 0.996842444, -0.0794048384, 0.990449011, -0.010948305, -0.137444243),i)
  673. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-1.06380701, 2.25257301, 0.536181211, -0.580544651, -0.0107682496, 0.814157248, -0.806997001, -0.125359416, -0.577096999, 0.108276591, -0.992052972, 0.0640868023),i)
  674. Head.C1 = Head.C1:lerp(CFrame.new(0.0249363557, -1.96275795, -0.108180299, -0.805434704, 0.592440784, -0.0169986095, -0.0573577061, -0.0493686944, 0.997132301, 0.589902639, 0.804099858, 0.0737443045),i)
  675. swait()
  676. end
  677. createSound("rbxassetid://1354419179",0.7,8)
  678. for i=1,30 do
  679. wait()
  680. pcall(function() createSound("rbxassetid://1354419179",0.8,5) end)
  681. local beam = Instance.new("Part",char)
  682. beam.Size = Vector3.new(6,6,100)
  683. beam.BrickColor = BrickColor.new("Really red")
  684. beam.Material = "Neon"
  685. beam.CanCollide=false
  686. beam.Transparency = 1
  687. beam.Anchored=true
  688. local position = mouse.Hit.p
  689. local distance = (rarm.CFrame.p - position).magnitude
  690. beam.Size = Vector3.new(6, 6, distance)
  691. beam.CFrame = CFrame.new(rarm.CFrame.p, position) * CFrame.new(0, 0, -distance / 2 + -2)
  692.  
  693. if mouse.Target then
  694. if mouse.Target.Parent:FindFirstChildOfClass("Humanoid") then
  695. local h = mouse.Target.Parent:FindFirstChildOfClass("Humanoid")
  696. if h ~= hum then
  697. h.Health = h.Health - h.MaxHealth / 6
  698. end
  699. end
  700. end
  701. if mouse.Target then
  702. if mouse.Target.Parent.Parent:FindFirstChildOfClass("Humanoid") then
  703. local h = mouse.Target.Parent.Parent:FindFirstChildOfClass("Humanoid")
  704. if h ~= hum then
  705. h.Health = h.Health - h.MaxHealth / 6
  706. end
  707. end
  708. end
  709. spawn(function()
  710. for i=1,10, 0.4 do
  711. swait()
  712. beam.Size = Vector3.new(i,i,beam.Size.Z)
  713. beam.Transparency = i/10
  714. end
  715. beam:Destroy()
  716. end)
  717. end
  718. wait(0.1)
  719. attacking=false
  720. movebody = true
  721. end
  722. pressingF = false
  723.  
  724. mouse.KeyDown:connect(function(key)
  725. local k = key:lower()
  726. if k == "f" then
  727. pressingF = true
  728. whip()
  729. end
  730. end)
  731.  
  732. mouse.KeyUp:connect(function(key)
  733. local k = key:lower()
  734. if k == "f" then
  735. pressingF = false
  736. end
  737. end)
  738.  
  739. function whip()
  740. attacking = true
  741. movebody = false
  742. local punched=false
  743. spawn(function()
  744. for i=0,0.13, 0.0013 do
  745. if movebody == true or attacking == false or punched == true then break end
  746. Torso.C1 = Torso.C1:lerp(CFrame.new(-0.0127004497, -1.79210389, 0.152598143, -0.9826141, 0.18552509, 0.00706116855, 0.0226545036, 0.0820649117, 0.996369541, 0.184272051, 0.979206741, -0.0848411322),i)
  747. LeftLeg.C1 = LeftLeg.C1:lerp(CFrame.new(-0.217573136, 1.44256806, 0.982333004, -0.0282963123, -0.0720653757, -0.996998429, -0.413804471, 0.90876627, -0.0539433509, 0.909925938, 0.411036015, -0.0555357076),i)
  748. RightLeg.C1 = RightLeg.C1:lerp(CFrame.new(0.113590628, 2.79427099, 0.02752655, -4.3675584e-08, 0.0404659845, 0.999180913, 0.105148442, 0.993641973, -0.0402416587, -0.99445653, 0.105062313, -0.00425497862),i)
  749. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.06116152, 0.197792649, 0.554134071, 0.283914477, 0.347440004, -0.893687844, 0.914802015, 0.181097761, 0.361027747, 0.287280321, -0.920048416, -0.26642254),i)
  750. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-1.77309728, 0.576332927, 0.445536077, -0.348231971, -0.0812811628, 0.933877885, -0.936926842, 0.062104363, -0.343963623, -0.030040117, -0.994754493, -0.097781226),i)
  751. Head.C1 = Head.C1:lerp(CFrame.new(-0.0374811105, -1.96583605, -0.0436500385, -0.952512562, -0.303425491, 0.0255501121, 0.0333683975, -0.0206092, 0.999230623, -0.302665472, 0.952632308, 0.0297553428),i)
  752. swait()
  753. end
  754. end)
  755. createSound("rbxassetid://876800936",0.7,8)
  756. wait(0.1)
  757. local power = 3
  758. repeat
  759. wait()
  760. Spells.Spell3.Size = Vector3.new(power,0.05,power)
  761. Spells.Spell3.CanCollide=false
  762. Weld10 = Instance.new("Weld")
  763. Weld10.Name = "SpellWeld"
  764. Weld10.Parent = Part1
  765. Weld10.C1 = CFrame.new(0.000245000236, 1.24710596, -0.00010599941, 1, 0, 0, 0, 0.999999762, 0, 0, 0, 1)
  766. Weld10.Part0 = Part31
  767. Weld10.Part1 = Part1
  768. power = power + 0.05
  769. until pressingF == false or power > 7.5
  770. punched = true
  771. Spells.Spell3.Size = Vector3.new(3,0.05,3)
  772. Spells.Spell3.CanCollide=false
  773. Weld10 = Instance.new("Weld")
  774. Weld10.Name = "SpellWeld"
  775. Weld10.Parent = Part1
  776. Weld10.C1 = CFrame.new(0.000245000236, 1.24710596, -0.00010599941, 1, 0, 0, 0, 0.999999762, 0, 0, 0, 1)
  777. Weld10.Part0 = Part31
  778. Weld10.Part1 = Part1
  779.  
  780. for i=0.1,0.2, 0.0013 do
  781. Torso.C1 = Torso.C1:lerp(CFrame.new(-0.050637722, -1.57592618, -0.289861709, -0.993514478, -0.109230503, 0.0315862447, 0.0506483503, -0.176418021, 0.983011425, -0.101802453, 0.978235841, 0.180806205),i)
  782. LeftLeg.C1 = LeftLeg.C1:lerp(CFrame.new(-0.208144277, 2.86795282, 0.434457392, -0.0282963067, -0.0720653683, -0.996998429, 0.117742933, 0.990214169, -0.0749167055, 0.992640853, -0.119509391, -0.0195342172),i)
  783. RightLeg.C1 = RightLeg.C1:lerp(CFrame.new(0.0902807415, 2.59190893, 0.0564393736, 0.00101210177, 0.0393193997, 0.999226153, 0.116191842, 0.992454112, -0.0391706079, -0.99322629, 0.116141573, -0.00356412865),i)
  784. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.93793046, 0.514535785, -0.13876757, -0.0389509574, -0.0212362912, -0.99901545, -0.186055884, 0.982444644, -0.0136298463, 0.98176682, 0.185341805, -0.0422182903),i)
  785. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-1.68404174, 1.85182118, 0.334121138, 0.163626835, -0.0516487658, 0.985169411, -0.984848678, -0.0666964352, 0.160076901, 0.0574395247, -0.996435642, -0.0617795624),i)
  786. Head.C1 = Head.C1:lerp(CFrame.new(-0.0374811105, -1.92743921, -0.336152017, -0.952512562, -0.303425491, 0.0255501121, 0.0932713151, -0.210860342, 0.973056197, -0.289862543, 0.929231405, 0.229148),i)
  787. swait()
  788. end
  789. wait(1)
  790. attacking=false
  791. movebody = true
  792. end
  793.  
  794. function throwsmallball()
  795. print'domini'
  796. movearms = false
  797. attacking = true
  798. righthand = not righthand
  799. if righting == true then return end
  800. if lefting == true then return end
  801. if righthand == true then
  802. if righting == true then return end
  803. righting=true
  804. else
  805. if lefting == true then return end
  806. lefting=true
  807. end
  808. local Ball = Instance.new("Part")
  809. local ParticleEmitter1 = Instance.new("ParticleEmitter")
  810. local BodyThrust2 = Instance.new("BodyThrust")
  811. local Attachment3 = Instance.new("Attachment")
  812. local Attachment4 = Instance.new("Attachment")
  813. Ball.Name = "Ball"
  814. Ball.Parent = nil
  815. Ball.Material = Enum.Material.Neon
  816. Ball.BrickColor = BrickColor.new("Lime green")
  817. Ball.Transparency = 0.6
  818. Ball.Anchored = false
  819. Ball.CanCollide = false
  820. Ball.Shape = Enum.PartType.Ball
  821. Ball.Size = Vector3.new(2,2,2)
  822. Ball.CFrame = CFrame.new(-14.2000122, 1.5, -29.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  823. Ball.BottomSurface = Enum.SurfaceType.Smooth
  824. Ball.TopSurface = Enum.SurfaceType.Smooth
  825. Ball.Position = Vector3.new(0,1000,0)
  826. local t = Instance.new("Trail",Ball)
  827. t.Attachment0 = Attachment3
  828. t.Attachment1 = Attachment4
  829. t.Texture = 'http://www.roblox.com/asset/?id=55054494'
  830. t.Color = ColorSequence.new(Color3.new(0,255,0))
  831. t.LightEmission=1
  832. t.LightInfluence=0
  833. t.FaceCamera=false
  834. t.Lifetime = 0.5
  835. t.Enabled=false
  836. ParticleEmitter1.Parent = Ball
  837. ParticleEmitter1.Transparency = NumberSequence.new(0.5,0.45625001192093,0.0625,1)
  838. ParticleEmitter1.Size = NumberSequence.new(1.2021857500076,0)
  839. ParticleEmitter1.LightEmission = 1
  840. ParticleEmitter1.Lifetime = NumberRange.new(1, 1)
  841. ParticleEmitter1.Rate = 100
  842. ParticleEmitter1.LockedToPart=true
  843. ParticleEmitter1.Speed = NumberRange.new(0, 0)
  844. ParticleEmitter1.Color = ColorSequence.new(Color3.new(0,255,0))
  845. BodyThrust2.Parent = Ball
  846. Attachment3.Parent = Ball
  847. Attachment3.CFrame = CFrame.new(0, 0.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  848. Attachment3.Position = Vector3.new(0, 0.8, 0)
  849. Attachment4.Parent = Ball
  850. Attachment4.CFrame = CFrame.new(0, -0.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  851. Attachment4.Position = Vector3.new(0, -0.8, 0)
  852. local ball = Ball
  853.  
  854. local w = nil
  855.  
  856. ball.Parent=char
  857. ball.Anchored=false
  858. if righthand == true then
  859. w = Instance.new("Weld")
  860. w.Parent = ball
  861. w.Part0 = ball
  862. w.Part1 = rarm
  863. w.C0 = CFrame.new(0,4,0)
  864. else
  865. w = Instance.new("Weld")
  866. w.Parent = ball
  867. w.Part0 = ball
  868. w.Part1 = larm
  869. w.C0 = CFrame.new(0,4,0)
  870. end
  871. --createSound("rbxassetid://360129736",0.1,2,false,ball)
  872. if righthand == true then
  873. for i=0.1,0.13, 0.0013 do
  874. swait()
  875. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.92139721, 0.609127104, 0.197871476, -0.13787961, -0.0786464438, -0.987321615, -3.47089579e-09, 0.996842444, -0.0794048384, 0.990449011, -0.010948305, -0.137444243),i)
  876. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-1.68974829, 2.40598106, 0.472159296, 0.0454996675, -0.116993919, 0.992089808, -0.292355925, -0.951196074, -0.0987632796, 0.955226541, -0.285549641, -0.0774829611),i)
  877. end
  878. elseif righthand == false then
  879. for i=0.1,0.13, 0.0013 do
  880. swait()
  881. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-2.12205648, 0.581189692, -0.428195477, 0.182427317, 0.100968368, 0.978021324, 0.136899486, 0.982415557, -0.126957461, -0.973642051, 0.157051116, 0.165396914),i)
  882. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.93507421, 2.44304132, 0.185819805, 0.00639864849, -0.0794032067, -0.996822, 0.13311252, -0.987903535, 0.0795472413, -0.991080344, -0.1331985, 0.00424831593),i)
  883. end
  884. end
  885. wait(0.01)
  886. local point = mouse.Hit.p
  887. w:Destroy()
  888. ball.CFrame = CFrame.new(ball.CFrame.p,point)
  889. ball.Anchored=true
  890. local hit=false
  891. spawn(function()
  892. repeat
  893. if w then w:Destroy() end
  894. swait()
  895. ball.CFrame = ball.CFrame*CFrame.new(0,0,-2)
  896. until ball == nil or hit == true
  897. end)
  898. createSound("rbxassetid://551051176",1,4,false,ball)
  899. createSound("rbxassetid://679372486",1,2,false,ball)
  900. t.Enabled = true
  901. spawn(function()
  902. local numb = 0
  903. while wait(0.03) do
  904. numb = numb + 1
  905. if w then w:Destroy() end
  906. for i,c in pairs (workspace:GetChildren()) do
  907. if c:IsA("Model") and c:FindFirstChildOfClass("Humanoid") then
  908. local v = c:FindFirstChild("Torso")
  909. if v == nil then v = c:FindFirstChild("HumanoidRootPart") end
  910. if v and v ~= char.HumanoidRootPart and v ~= torso then
  911. if (v.Position-ball.Position).magnitude < (v.Size).magnitude*2 then
  912. if hit == false then
  913. hit=true
  914. createSound("rbxassetid://142070127",1,4,false,v)
  915. local h = c:FindFirstChildOfClass("Humanoid")
  916. if h then
  917. h.Health = h.Health - math.random(h.MaxHealth/10,h.MaxHealth/3)
  918. end
  919. for i=1,5, 0.25 do
  920. swait()
  921. ball.Size = ball.Size+Vector3.new(i/5,i/5,i/5)
  922. ball.Transparency = i/5
  923. end
  924. ball:Destroy()
  925. break
  926. else
  927. break
  928. end
  929. end
  930. end
  931. end
  932. end
  933. if ball == nil then break end
  934. if ball.Parent == nil then break end
  935. if hit == true then break end
  936. if numb > 40 then ball:Destroy() break end
  937. end
  938. end)
  939. if righthand == true then
  940. for i=0.1,0.13, 0.001 do
  941. swait()
  942. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.92139721, 0.609127104, 0.197871476, -0.13787961, -0.0786464438, -0.987321615, -3.47089579e-09, 0.996842444, -0.0794048384, 0.990449011, -0.010948305, -0.137444243),i)
  943. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-1.80503547, 1.5968492, 0.649080038, 0.0553190857, -0.0553134792, 0.996935487, -0.992296994, 0.107798807, 0.0610427633, -0.11084494, -0.992632806, -0.0489240773),i)
  944. end
  945. elseif righthand == false then
  946. for i=0.1,0.13, 0.001 do
  947. swait()
  948. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-2.12205648, 0.581189692, -0.428195477, 0.182427317, 0.100968368, 0.978021324, 0.136899486, 0.982415557, -0.126957461, -0.973642051, 0.157051116, 0.165396914),i)
  949. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(2.04465604, 1.06834006, 0.579983354, 0.115892708, -0.00910150446, -0.993220031, 0.990238369, 0.0790203959, 0.114820689, 0.0774396211, -0.996831417, 0.0181705467),i)
  950. end
  951. end
  952. movearms = true
  953. attacking=false
  954. if righthand == true then
  955. righting=false
  956. else
  957. lefting=false
  958. end
  959. end
  960.  
  961.  
  962. function throwball()
  963. print'do'
  964. movearms = false
  965. attacking = true
  966. local Ball = Instance.new("Part")
  967. local ParticleEmitter1 = Instance.new("ParticleEmitter")
  968. local BodyThrust2 = Instance.new("BodyThrust")
  969. local Attachment3 = Instance.new("Attachment")
  970. local Attachment4 = Instance.new("Attachment")
  971. Ball.Name = "Ball"
  972. Ball.Parent = nil
  973. Ball.Material = Enum.Material.Neon
  974. Ball.Color = Color3.new(1, 81/255, 0)
  975. print(Ball.Color)
  976. Ball.Transparency = 0.5
  977. Ball.Anchored = true
  978. Ball.CanCollide = false
  979. Ball.Shape = Enum.PartType.Ball
  980. Ball.Size = Vector3.new(3, 3, 3)
  981. Ball.CFrame = CFrame.new(-14.2000122, 1.5, -29.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  982. Ball.BottomSurface = Enum.SurfaceType.Smooth
  983. Ball.TopSurface = Enum.SurfaceType.Smooth
  984. Ball.Position = Vector3.new(-14.2000122, 1.5, -29.5)
  985. local t = Instance.new("Trail",Ball)
  986. t.Attachment0 = Attachment3
  987. t.Attachment1 = Attachment4
  988. t.Texture = 'http://www.roblox.com/asset/?id=55054494'
  989. t.Color = ColorSequence.new(Color3.new(255,51,0))
  990. t.LightEmission=1
  991. t.LightInfluence=0
  992. t.FaceCamera=false
  993. t.Lifetime = 0.5
  994. ParticleEmitter1.Parent = Ball
  995. ParticleEmitter1.Transparency = NumberSequence.new(0.5,0.45625001192093,0.0625,1)
  996. ParticleEmitter1.Size = NumberSequence.new(1.2021857500076,0)
  997. ParticleEmitter1.Color = ColorSequence.new(Color3.new(1, 0.14902, 0),Color3.new(1, 0.14902, 0))
  998. ParticleEmitter1.LightEmission = 1
  999. ParticleEmitter1.Lifetime = NumberRange.new(1, 1)
  1000. ParticleEmitter1.Rate = 100
  1001. ParticleEmitter1.LockedToPart=true
  1002. ParticleEmitter1.Speed = NumberRange.new(0, 0)
  1003. ParticleEmitter1.Color = ColorSequence.new(Color3.new(1, 0.14902, 0),Color3.new(1, 0.14902, 0))
  1004. BodyThrust2.Parent = Ball
  1005. Attachment3.Parent = Ball
  1006. Attachment3.CFrame = CFrame.new(0, 1.29023409, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1007. Attachment3.Position = Vector3.new(0, 1.29023409, 0)
  1008. Attachment4.Parent = Ball
  1009. Attachment4.CFrame = CFrame.new(0, -1.24282432, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1010. Attachment4.Position = Vector3.new(0, -1.24282432, 0)
  1011. local ball = Ball
  1012.  
  1013. local w = Instance.new("Weld")
  1014. w.Parent = ball
  1015. w.Part0 = ball
  1016. w.Part1 = rarm
  1017. w.C0 = CFrame.new(0,4,0)
  1018.  
  1019. ball.Parent=char
  1020. ball.Anchored=false
  1021. spawn(function()
  1022. for i=0,5, 0.05 do
  1023. ball.Size = Vector3.new(i,i,i)
  1024. if w ~= nil then w:Destroy() end
  1025. w = Instance.new("Weld")
  1026. w.Parent = ball
  1027. w.Part0 = ball
  1028. w.Part1 = rarm
  1029. w.C0 = CFrame.new(0,4,0)
  1030. swait()
  1031. end
  1032. end)
  1033. createSound("rbxassetid://876800936",0.3,4,false,ball)
  1034. for i=0,0.13, 0.0013 do
  1035. swait()
  1036. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.92139709, 0.609127164, 0.197871447, -0.13787961, -0.0786464438, -0.987321615, -3.47089579e-09, 0.996842444, -0.0794048384, 0.990449011, -0.0109483041, -0.137444243),i)
  1037. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-1.93205297, 1.92837679, -0.249813452, -0.0421406105, 0.0412775576, 0.99825865, 0.24969551, -0.967005312, 0.0505259223, 0.967406988, 0.251389891, 0.0304433741),i)
  1038. end
  1039. wait(0.01)
  1040. local point = mouse.Hit.p
  1041. w:Destroy()
  1042. ball.CFrame = CFrame.new(ball.CFrame.p,point)
  1043. ball.Anchored=true
  1044. local hit=false
  1045. spawn(function()
  1046. repeat
  1047. if w then w:Destroy() end
  1048. swait()
  1049. ball.CFrame = ball.CFrame*CFrame.new(0,0,-2)
  1050. until ball == nil or hit == true
  1051. end)
  1052. createSound("rbxassetid://551051176",1,4,false,ball)
  1053. createSound("rbxassetid://679372486",0.5,4,false,ball)
  1054.  
  1055. spawn(function()
  1056. local numb = 0
  1057. while wait(0.03) do
  1058. numb = numb + 0.1
  1059. if w then w:Destroy() end
  1060. for i,c in pairs (workspace:GetChildren()) do
  1061. if c:IsA("Model") and c:FindFirstChildOfClass("Humanoid") then
  1062. local v = c:FindFirstChild("Torso")
  1063. if v == nil then v = c:FindFirstChild("HumanoidRootPart") end
  1064. if v and v ~= char.HumanoidRootPart and v ~= torso then
  1065. if (v.Position-ball.Position).magnitude < (v.Size).magnitude*2 then
  1066. if hit == false then
  1067. hit=true
  1068. createSound("rbxassetid://142070127",0.8,4,false,v)
  1069. local h = c:FindFirstChildOfClass("Humanoid")
  1070. if h then
  1071. h.Health = h.Health - math.random(h.MaxHealth/3,h.MaxHealth/1.5)
  1072. end
  1073. for i=1,10, 0.25 do
  1074. swait()
  1075. ball.Size = ball.Size+Vector3.new(i/5,i/5,i/5)
  1076. ball.Transparency = i/10
  1077. end
  1078. ball:Destroy()
  1079. break
  1080. else
  1081. break
  1082. end
  1083. end
  1084. end
  1085. end
  1086. end
  1087. if ball == nil then break end
  1088. if ball.Parent == nil then break end
  1089. if hit == true then break end
  1090. if numb > 100 then ball:Destroy() break end
  1091. end
  1092. end)
  1093. for i=0.1,0.13, 0.001 do
  1094. swait()
  1095. local point = mouse.Hit.p
  1096. LeftArm.C1 = LeftArm.C1:lerp(CFrame.new(1.93793035, 0.525868058, 0.0558443964, -0.0389509574, -0.0212362912, -0.99901545, 0.00805827603, 0.999734938, -0.0215657726, 0.999208629, -0.00889034942, -0.0387694985),i)
  1097. RightArm.C1 = RightArm.C1:lerp(CFrame.new(-2.12205672, 1.05030358, 0.322834671, 0.182427317, 0.100968368, 0.978021324, -0.969601631, 0.183454365, 0.161917478, -0.163073719, -0.977829218, 0.131366178),i)
  1098.  
  1099. end
  1100. movearms = true
  1101. attacking=false
  1102. wait(10)
  1103. ball:Destroy()
  1104. end
  1105.  
  1106. mouse.KeyDown:connect(function(k)
  1107. local key = k:lower()
  1108. if attacking == true then return end
  1109. if key == "q" then
  1110. throwball()
  1111. end
  1112. if key == "e" then
  1113. throwsmallball()
  1114. end
  1115. if key == "g" then
  1116. lazor()
  1117. end
  1118. end)
  1119.  
  1120. local mouse = game.Players.LocalPlayer:GetMouse()
  1121. repeat wait() until mouse
  1122. local plr = game.Players.LocalPlayer
  1123. local torso = plr.Character.Torso
  1124. local flying = true
  1125. local deb = true
  1126. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  1127. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  1128. local maxspeed = 90
  1129. local speed = 0
  1130. function Fly()
  1131. local bg = Instance.new("BodyGyro", torso)
  1132. bg.P = 9e4
  1133. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  1134. bg.cframe = torso.CFrame
  1135. local bv = Instance.new("BodyVelocity", torso)
  1136. bv.velocity = Vector3.new(0,0.1,0)
  1137. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  1138. repeat wait()
  1139. plr.Character.Humanoid.PlatformStand = true
  1140. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  1141. speed = speed+.5+(speed/maxspeed)
  1142. if speed > maxspeed then
  1143. speed = maxspeed
  1144. end
  1145. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  1146. speed = speed-1
  1147. if speed < 0 then
  1148. speed = 0
  1149. end
  1150. end
  1151. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  1152. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  1153. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  1154. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  1155. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  1156. else
  1157. bv.velocity = Vector3.new(0,0.1,0)
  1158. end
  1159. bg.cframe = bg.cframe:lerp(game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0), 0.2)
  1160. until not flying
  1161. ctrl = {f = 0, b = 0, l = 0, r = 0}
  1162. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  1163. speed = 0
  1164. bg:Destroy()
  1165. bv:Destroy()
  1166. plr.Character.Humanoid.PlatformStand = false
  1167. end
  1168. mouse.KeyDown:connect(function(key)
  1169. if key:lower() == "e" then
  1170. elseif key:lower() == "w" then
  1171. ctrl.f = 1
  1172. elseif key:lower() == "s" then
  1173. ctrl.b = -1
  1174. elseif key:lower() == "a" then
  1175. ctrl.l = -1
  1176. elseif key:lower() == "d" then
  1177. ctrl.r = 1
  1178. end
  1179. end)
  1180. mouse.KeyUp:connect(function(key)
  1181. if key:lower() == "w" then
  1182. ctrl.f = 0
  1183. elseif key:lower() == "s" then
  1184. ctrl.b = 0
  1185. elseif key:lower() == "a" then
  1186. ctrl.l = 0
  1187. elseif key:lower() == "d" then
  1188. ctrl.r = 0
  1189. end
  1190. end)
  1191.  
  1192. UIS = game:GetService("UserInputService")
  1193. UIS.InputBegan:connect(function(keyCode,Should)
  1194. if Should == false then
  1195. local KC = keyCode.KeyCode
  1196. if KC == Enum.KeyCode.LeftShift then
  1197. flying = true
  1198. Fly()
  1199. end
  1200. end
  1201. end)
  1202.  
  1203. UIS.InputEnded:connect(function(keyCode,Should)
  1204. if Should == false then
  1205. local KC = keyCode.KeyCode
  1206. if KC == Enum.KeyCode.LeftShift then
  1207. flying = false
  1208. end
  1209. end
  1210. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement