Advertisement
HenloMyDude

towerbattleszomboe wip

Aug 28th, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.95 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. do
  4. print("FE Compatibility code by Mokiros")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83. wait(0.2)
  84. local plr = owner
  85. local char = plr.Character
  86. local hum = char.Humanoid
  87. local hed = char.Head
  88. local root = char.HumanoidRootPart
  89. local rootj = root.RootJoint
  90. local tors = char.Torso
  91. tors.BrickColor = BrickColor.new("Brown")
  92. local ra = char["Right Arm"]
  93. local la = char["Left Arm"]
  94. local rl = char["Right Leg"]
  95. rl.BrickColor = tors.BrickColor
  96. local ll = char["Left Leg"]
  97. ll.BrickColor = tors.BrickColor
  98. local neck = tors["Neck"]
  99. local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  100. local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
  101. local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
  102. local maincolor = BrickColor.new("Institutional white")
  103. -------------------------------------------------------
  104. --Start Good Stuff--
  105. -------------------------------------------------------
  106. cam = game.Workspace.CurrentCamera
  107. CF = CFrame.new
  108. angles = CFrame.Angles
  109. attack = false
  110. Euler = CFrame.fromEulerAnglesXYZ
  111. Rad = math.rad
  112. IT = Instance.new
  113. BrickC = BrickColor.new
  114. Cos = math.cos
  115. Acos = math.acos
  116. Sin = math.sin
  117. Asin = math.asin
  118. Abs = math.abs
  119. Mrandom = math.random
  120. Floor = math.floor
  121. Character = char
  122. Torso = tors
  123.  
  124. for i,v in pairs(Character:children()) do
  125. if v:IsA("Hair") then
  126. v:Destroy()
  127. end
  128. end
  129. for i,v in pairs(Character:children()) do
  130. if v:IsA("Shirt") then
  131. v:Destroy()
  132. end
  133. end
  134. for i,v in pairs(Character:children()) do
  135. if v:IsA("Pants") then
  136. v:Destroy()
  137. end
  138. end
  139. for i,v in pairs(Character:children()) do
  140. if v:IsA("Graphic Shirt") then
  141. v:Destroy()
  142. end
  143. end
  144. for i,v in pairs(Character:children()) do
  145. if v:IsA("GraphicShirt") then
  146. v:Destroy()
  147. end
  148. end
  149.  
  150. for _,v in pairs(Character:children()) do
  151. if v:IsA("Shirt") then
  152. v.ShirtTemplate = "rbxassetid://0"
  153. elseif v:IsA("Pants") then
  154. v.PantsTemplate = "rbxassetid://0"
  155. elseif v:IsA("ShirtGraphic") then
  156. v:Remove()
  157. wait(.1)
  158. Torso.roblox:Remove()
  159. elseif v:IsA("Accessory") then
  160. v:Remove()
  161. end
  162. end
  163. -------------------------------------------------------
  164. --End Good Stuff--
  165. -------------------------------------------------------
  166. Player_Size = 0.6
  167. for _,v in pairs (char:children()) do
  168. if v:IsA("Part") and v.Name ~= "Torso" and v.Name ~= "Right Leg" and v.Name ~= "Left Leg" then
  169. v.BrickColor = BrickColor.new("Bright green")
  170. end
  171. end
  172.  
  173. local AddInstance = function(Object, ...)
  174. local Obj = Instance.new(Object)
  175. for i,v in next,(...) do
  176. Obj[i] = v
  177. end
  178. return Obj
  179. end
  180.  
  181. hed.face.Transparency = 1
  182. hed.face.Texture = "rbxassetid://0"
  183.  
  184. necko = CF(0 * Player_Size, 1 * Player_Size, 0 * Player_Size, -1 * Player_Size, -0 * Player_Size, -0 * Player_Size, 0 * Player_Size, 0 * Player_Size, 1 * Player_Size, 0 * Player_Size, 1 * Player_Size, 0 * Player_Size)
  185. RW = Instance.new("Weld")
  186. LW = Instance.new("Weld")
  187. RH = tors["Right Hip"]
  188. LH = tors["Left Hip"]
  189. RSH = tors["Right Shoulder"]
  190. LSH = tors["Left Shoulder"]
  191. RW.Name = "RW"
  192. RW.Part0 = tors
  193. RW.C0 = CF(1.5, 0.5, 0)
  194. RW.C1 = CF(0, 0.5, 0)
  195. RW.Part1 = ra
  196. RW.Parent = tors
  197. LW.Name = "LW"
  198. LW.Part0 = tors
  199. LW.C0 = CF(-1.5, 0.5, 0)
  200. LW.C1 = CF(0, 0.5, 0)
  201. LW.Part1 = la
  202. LW.Parent = tors
  203. Effects = {}
  204. -------------------------------------------------------
  205. --Start HeartBeat--
  206. -------------------------------------------------------
  207. ArtificialHB = Instance.new("BindableEvent", script)
  208. ArtificialHB.Name = "Heartbeat"
  209. script:WaitForChild("Heartbeat")
  210.  
  211. frame = 1 / 60
  212. tf = 0
  213. allowframeloss = false
  214. tossremainder = false
  215.  
  216.  
  217. lastframe = tick()
  218. script.Heartbeat:Fire()
  219.  
  220.  
  221. game:GetService("RunService").Heartbeat:connect(function(s, p)
  222. tf = tf + s
  223. if tf >= frame then
  224. if allowframeloss then
  225. script.Heartbeat:Fire()
  226. lastframe = tick()
  227. else
  228. for i = 1, math.floor(tf / frame) do
  229. script.Heartbeat:Fire()
  230. end
  231. lastframe = tick()
  232. end
  233. if tossremainder then
  234. tf = 0
  235. else
  236. tf = tf - frame * math.floor(tf / frame)
  237. end
  238. end
  239. end)
  240. -------------------------------------------------------
  241. --End HeartBeat--
  242. -------------------------------------------------------
  243.  
  244. -------------------------------------------------------
  245. --Start Important Functions--
  246. -------------------------------------------------------
  247. function swait(num)
  248. if num == 0 or num == nil then
  249. game:service("RunService").Stepped:wait(0)
  250. else
  251. for i = 0, num do
  252. game:service("RunService").Stepped:wait(0)
  253. end
  254. end
  255. end
  256. function thread(f)
  257. coroutine.resume(coroutine.create(f))
  258. end
  259. function clerp(a, b, t)
  260. local qa = {
  261. QuaternionFromCFrame(a)
  262. }
  263. local qb = {
  264. QuaternionFromCFrame(b)
  265. }
  266. local ax, ay, az = a.x, a.y, a.z
  267. local bx, by, bz = b.x, b.y, b.z
  268. local _t = 1 - t
  269. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  270. end
  271. function QuaternionFromCFrame(cf)
  272. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  273. local trace = m00 + m11 + m22
  274. if trace > 0 then
  275. local s = math.sqrt(1 + trace)
  276. local recip = 0.5 / s
  277. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  278. else
  279. local i = 0
  280. if m00 < m11 then
  281. i = 1
  282. end
  283. if m22 > (i == 0 and m00 or m11) then
  284. i = 2
  285. end
  286. if i == 0 then
  287. local s = math.sqrt(m00 - m11 - m22 + 1)
  288. local recip = 0.5 / s
  289. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  290. elseif i == 1 then
  291. local s = math.sqrt(m11 - m22 - m00 + 1)
  292. local recip = 0.5 / s
  293. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  294. elseif i == 2 then
  295. local s = math.sqrt(m22 - m00 - m11 + 1)
  296. local recip = 0.5 / s
  297. return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  298. end
  299. end
  300. end
  301. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  302. local xs, ys, zs = x + x, y + y, z + z
  303. local wx, wy, wz = w * xs, w * ys, w * zs
  304. local xx = x * xs
  305. local xy = x * ys
  306. local xz = x * zs
  307. local yy = y * ys
  308. local yz = y * zs
  309. local zz = z * zs
  310. return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy))
  311. end
  312. function QuaternionSlerp(a, b, t)
  313. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  314. local startInterp, finishInterp
  315. if cosTheta >= 1.0E-4 then
  316. if 1 - cosTheta > 1.0E-4 then
  317. local theta = math.acos(cosTheta)
  318. local invSinTheta = 1 / Sin(theta)
  319. startInterp = Sin((1 - t) * theta) * invSinTheta
  320. finishInterp = Sin(t * theta) * invSinTheta
  321. else
  322. startInterp = 1 - t
  323. finishInterp = t
  324. end
  325. elseif 1 + cosTheta > 1.0E-4 then
  326. local theta = math.acos(-cosTheta)
  327. local invSinTheta = 1 / Sin(theta)
  328. startInterp = Sin((t - 1) * theta) * invSinTheta
  329. finishInterp = Sin(t * theta) * invSinTheta
  330. else
  331. startInterp = t - 1
  332. finishInterp = t
  333. end
  334. return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp
  335. end
  336. function rayCast(Position, Direction, Range, Ignore)
  337. return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  338. end
  339. local RbxUtility = LoadLibrary("RbxUtility")
  340. local Create = RbxUtility.Create
  341.  
  342. -------------------------------------------------------
  343. --Start Damage Function--
  344. -------------------------------------------------------
  345. function Damage(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch)
  346. if hit.Parent == nil then
  347. return
  348. end
  349. local h = hit.Parent:FindFirstChildOfClass("Humanoid")
  350. for _, v in pairs(hit.Parent:children()) do
  351. if v:IsA("Humanoid") then
  352. h = v
  353. end
  354. end
  355. if h ~= nil and hit.Parent.Name ~= char.Name and hit.Parent:FindFirstChild("UpperTorso") ~= nil then
  356.  
  357. hit.Parent:FindFirstChild("Head"):BreakJoints()
  358. end
  359.  
  360. if h ~= nil and hit.Parent.Name ~= char.Name and hit.Parent:FindFirstChild("Torso") ~= nil then
  361. if hit.Parent:findFirstChild("DebounceHit") ~= nil then
  362. if hit.Parent.DebounceHit.Value == true then
  363. return
  364. end
  365. end
  366. if insta == true then
  367. hit.Parent:FindFirstChild("Head"):BreakJoints()
  368. end
  369. local c = Create("ObjectValue"){
  370. Name = "creator",
  371. Value = game:service("Players").LocalPlayer,
  372. Parent = h,
  373. }
  374. game:GetService("Debris"):AddItem(c, .5)
  375. if HitSound ~= nil and HitPitch ~= nil then
  376. CFuncs.Sound.Create(HitSound, hit, 1, HitPitch)
  377. end
  378. local Damage = math.random(minim, maxim)
  379. local blocked = false
  380. local block = hit.Parent:findFirstChild("Block")
  381. if block ~= nil then
  382. if block.className == "IntValue" then
  383. if block.Value > 0 then
  384. blocked = true
  385. block.Value = block.Value - 1
  386. print(block.Value)
  387. end
  388. end
  389. end
  390. if blocked == false then
  391. h.Health = h.Health - Damage
  392. ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, tors.BrickColor.Color)
  393. else
  394. h.Health = h.Health - (Damage / 2)
  395. ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, tors.BrickColor.Color)
  396. end
  397. if Type == "Knockdown" then
  398. local hum = hit.Parent.Humanoid
  399. hum.PlatformStand = true
  400. coroutine.resume(coroutine.create(function(HHumanoid)
  401. swait(1)
  402. HHumanoid.PlatformStand = false
  403. end), hum)
  404. local angle = (hit.Position - (Property.Position + Vector3.new(0, 0, 0))).unit
  405. local bodvol = Create("BodyVelocity"){
  406. velocity = angle * knockback,
  407. P = 5000,
  408. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  409. Parent = hit,
  410. }
  411. local rl = Create("BodyAngularVelocity"){
  412. P = 3000,
  413. maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
  414. angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
  415. Parent = hit,
  416. }
  417. game:GetService("Debris"):AddItem(bodvol, .5)
  418. game:GetService("Debris"):AddItem(rl, .5)
  419. elseif Type == "Normal" then
  420. local vp = Create("BodyVelocity"){
  421. P = 500,
  422. maxForce = Vector3.new(math.huge, 0, math.huge),
  423. velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05,
  424. }
  425. if knockback > 0 then
  426. vp.Parent = hit.Parent.Torso
  427. end
  428. game:GetService("Debris"):AddItem(vp, .5)
  429. elseif Type == "Up" then
  430. local bodyVelocity = Create("BodyVelocity"){
  431. velocity = Vector3.new(0, 20, 0),
  432. P = 5000,
  433. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  434. Parent = hit,
  435. }
  436. game:GetService("Debris"):AddItem(bodyVelocity, .5)
  437. elseif Type == "DarkUp" then
  438. coroutine.resume(coroutine.create(function()
  439. for i = 0, 1, 0.1 do
  440. swait()
  441. Effects.Block.Create(BrickColor.new("Black"), hit.Parent.Torso.CFrame, 5, 5, 5, 1, 1, 1, .08, 1)
  442. end
  443. end))
  444. local bodyVelocity = Create("BodyVelocity"){
  445. velocity = Vector3.new(0, 20, 0),
  446. P = 5000,
  447. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  448. Parent = hit,
  449. }
  450. game:GetService("Debris"):AddItem(bodyVelocity, 1)
  451. elseif Type == "Snare" then
  452. local bp = Create("BodyPosition"){
  453. P = 2000,
  454. D = 100,
  455. maxForce = Vector3.new(math.huge, math.huge, math.huge),
  456. position = hit.Parent.Torso.Position,
  457. Parent = hit.Parent.Torso,
  458. }
  459. game:GetService("Debris"):AddItem(bp, 1)
  460. elseif Type == "Freeze" then
  461. local BodPos = Create("BodyPosition"){
  462. P = 50000,
  463. D = 1000,
  464. maxForce = Vector3.new(math.huge, math.huge, math.huge),
  465. position = hit.Parent.Torso.Position,
  466. Parent = hit.Parent.Torso,
  467. }
  468. local BodGy = Create("BodyGyro") {
  469. maxTorque = Vector3.new(4e+005, 4e+005, 4e+005) * math.huge ,
  470. P = 20e+003,
  471. Parent = hit.Parent.Torso,
  472. cframe = hit.Parent.Torso.CFrame,
  473. }
  474. hit.Parent.Torso.Anchored = true
  475. coroutine.resume(coroutine.create(function(Part)
  476. swait(1.5)
  477. Part.Anchored = false
  478. end), hit.Parent.Torso)
  479. game:GetService("Debris"):AddItem(BodPos, 3)
  480. game:GetService("Debris"):AddItem(BodGy, 3)
  481. end
  482. local debounce = Create("BoolValue"){
  483. Name = "DebounceHit",
  484. Parent = hit.Parent,
  485. Value = true,
  486. }
  487. game:GetService("Debris"):AddItem(debounce, Delay)
  488. c = Create("ObjectValue"){
  489. Name = "creator",
  490. Value = Player,
  491. Parent = h,
  492. }
  493. game:GetService("Debris"):AddItem(c, .5)
  494. end
  495. end
  496. -------------------------------------------------------
  497. --End Damage Function--
  498. -------------------------------------------------------
  499.  
  500. -------------------------------------------------------
  501. --Start Damage Function Customization--
  502. -------------------------------------------------------
  503. function ShowDamage(Pos, Text, Time, Color)
  504. local Rate = (1 / 30)
  505. local Pos = (Pos or Vector3.new(0, 0, 0))
  506. local Text = (Text or "")
  507. local Time = (Time or 2)
  508. local Color = (Color or Color3.new(1, 0, 1))
  509. local EffectPart = CFuncs.Part.Create(workspace, "SmoothPlastic", 0, 1, BrickColor.new(Color), "Effect", Vector3.new(0, 0, 0))
  510. EffectPart.Anchored = true
  511. local BillboardGui = Create("BillboardGui"){
  512. Size = UDim2.new(3, 0, 3, 0),
  513. Adornee = EffectPart,
  514. Parent = EffectPart,
  515. }
  516. local TextLabel = Create("TextLabel"){
  517. BackgroundTransparency = 1,
  518. Size = UDim2.new(1, 0, 1, 0),
  519. Text = Text,
  520. Font = "Bodoni",
  521. TextColor3 = Color,
  522. TextScaled = true,
  523. TextStrokeColor3 = Color3.fromRGB(0,0,0),
  524. Parent = BillboardGui,
  525. }
  526. game.Debris:AddItem(EffectPart, (Time))
  527. EffectPart.Parent = game:GetService("Workspace")
  528. delay(0, function()
  529. local Frames = (Time / Rate)
  530. for Frame = 1, Frames do
  531. wait(Rate)
  532. local Percent = (Frame / Frames)
  533. EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0)
  534. TextLabel.TextTransparency = Percent
  535. end
  536. if EffectPart and EffectPart.Parent then
  537. EffectPart:Destroy()
  538. end
  539. end)
  540. end
  541. -------------------------------------------------------
  542. --End Damage Function Customization--
  543. -------------------------------------------------------
  544.  
  545. function MagniDamage(Part, magni, mindam, maxdam, knock, Type)
  546. for _, c in pairs(workspace:children()) do
  547. local hum = c:findFirstChild("Humanoid")
  548. if hum ~= nil then
  549. local head = c:findFirstChild("Head")
  550. if head ~= nil then
  551. local targ = head.Position - Part.Position
  552. local mag = targ.magnitude
  553. if magni >= mag and c.Name ~= plr.Name then
  554. Damage(head, head, mindam, maxdam, knock, Type, root, 0.1, "http://www.roblox.com/asset/?id=0", 1.2)
  555. end
  556. end
  557. end
  558. end
  559. end
  560.  
  561.  
  562. CFuncs = {
  563. Part = {
  564. Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  565. local Part = Create("Part")({
  566. Parent = Parent,
  567. Reflectance = Reflectance,
  568. Transparency = Transparency,
  569. CanCollide = false,
  570. Locked = true,
  571. BrickColor = BrickColor.new(tostring(BColor)),
  572. Name = Name,
  573. Size = Size,
  574. Material = Material
  575. })
  576. RemoveOutlines(Part)
  577. return Part
  578. end
  579. },
  580. Mesh = {
  581. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  582. local Msh = Create(Mesh)({
  583. Parent = Part,
  584. Offset = OffSet,
  585. Scale = Scale
  586. })
  587. if Mesh == "SpecialMesh" then
  588. Msh.MeshType = MeshType
  589. Msh.MeshId = MeshId
  590. end
  591. return Msh
  592. end
  593. },
  594. Mesh = {
  595. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  596. local Msh = Create(Mesh)({
  597. Parent = Part,
  598. Offset = OffSet,
  599. Scale = Scale
  600. })
  601. if Mesh == "SpecialMesh" then
  602. Msh.MeshType = MeshType
  603. Msh.MeshId = MeshId
  604. end
  605. return Msh
  606. end
  607. },
  608. Weld = {
  609. Create = function(Parent, Part0, Part1, C0, C1)
  610. local Weld = Create("Weld")({
  611. Parent = Parent,
  612. Part0 = Part0,
  613. Part1 = Part1,
  614. C0 = C0,
  615. C1 = C1
  616. })
  617. return Weld
  618. end
  619. },
  620. Sound = {
  621. Create = function(id, par, vol, pit)
  622. coroutine.resume(coroutine.create(function()
  623. local S = Create("Sound")({
  624. Volume = vol,
  625. Pitch = pit or 1,
  626. SoundId = id,
  627. Parent = par or workspace
  628. })
  629. wait()
  630. S:play()
  631. game:GetService("Debris"):AddItem(S, 6)
  632. end))
  633. end
  634. },
  635. ParticleEmitter = {
  636. Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
  637. local fp = Create("ParticleEmitter")({
  638. Parent = Parent,
  639. Color = ColorSequence.new(Color1, Color2),
  640. LightEmission = LightEmission,
  641. Size = Size,
  642. Texture = Texture,
  643. Transparency = Transparency,
  644. ZOffset = ZOffset,
  645. Acceleration = Accel,
  646. Drag = Drag,
  647. LockedToPart = LockedToPart,
  648. VelocityInheritance = VelocityInheritance,
  649. EmissionDirection = EmissionDirection,
  650. Enabled = Enabled,
  651. Lifetime = LifeTime,
  652. Rate = Rate,
  653. Rotation = Rotation,
  654. RotSpeed = RotSpeed,
  655. Speed = Speed,
  656. VelocitySpread = VelocitySpread
  657. })
  658. return fp
  659. end
  660. }
  661. }
  662. function RemoveOutlines(part)
  663. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  664. end
  665. function CreatePart(FormFactor, Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  666. local Part = Create("Part")({
  667. formFactor = FormFactor,
  668. Parent = Parent,
  669. Reflectance = Reflectance,
  670. Transparency = Transparency,
  671. CanCollide = false,
  672. Locked = true,
  673. BrickColor = BrickColor.new(tostring(BColor)),
  674. Name = Name,
  675. Size = Size,
  676. Material = Material
  677. })
  678. RemoveOutlines(Part)
  679. return Part
  680. end
  681. function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  682. local Msh = Create(Mesh)({
  683. Parent = Part,
  684. Offset = OffSet,
  685. Scale = Scale
  686. })
  687. if Mesh == "SpecialMesh" then
  688. Msh.MeshType = MeshType
  689. Msh.MeshId = MeshId
  690. end
  691. return Msh
  692. end
  693. function CreateWeld(Parent, Part0, Part1, C0, C1)
  694. local Weld = Create("Weld")({
  695. Parent = Parent,
  696. Part0 = Part0,
  697. Part1 = Part1,
  698. C0 = C0,
  699. C1 = C1
  700. })
  701. return Weld
  702. end
  703.  
  704. function HitboxFunction(Pose, lifetime, siz1, siz2, siz3, Radie, Min, Max, kb, atype)
  705. local Hitboxpart = Instance.new("Part", EffectModel)
  706. RemoveOutlines(Hitboxpart)
  707. Hitboxpart.Size = Vector3.new(siz1 * Player_Size, siz2 * Player_Size, siz3 * Player_Size)
  708. Hitboxpart.CanCollide = false
  709. Hitboxpart.Transparency = 1
  710. Hitboxpart.Anchored = true
  711. Hitboxpart.CFrame = Pose
  712. game:GetService("Debris"):AddItem(Hitboxpart, lifetime)
  713. MagniDamage(Hitboxpart, Radie, Min, Max, kb, atype)
  714. end
  715.  
  716. -------------------------------------------------------
  717. --Start Effect Function--
  718. -------------------------------------------------------
  719. EffectModel = Instance.new("Model", char)
  720. Effects = {
  721. Block = {
  722. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type)
  723. local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
  724. prt.Anchored = true
  725. prt.CFrame = cframe
  726. local msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  727. game:GetService("Debris"):AddItem(prt, 10)
  728. if Type == 1 or Type == nil then
  729. table.insert(Effects, {
  730. prt,
  731. "Block1",
  732. delay,
  733. x3,
  734. y3,
  735. z3,
  736. msh
  737. })
  738. elseif Type == 2 then
  739. table.insert(Effects, {
  740. prt,
  741. "Block2",
  742. delay,
  743. x3,
  744. y3,
  745. z3,
  746. msh
  747. })
  748. else
  749. table.insert(Effects, {
  750. prt,
  751. "Block3",
  752. delay,
  753. x3,
  754. y3,
  755. z3,
  756. msh
  757. })
  758. end
  759. end
  760. },
  761. Sphere = {
  762. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  763. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  764. prt.Anchored = true
  765. prt.CFrame = cframe
  766. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  767. game:GetService("Debris"):AddItem(prt, 10)
  768. table.insert(Effects, {
  769. prt,
  770. "Cylinder",
  771. delay,
  772. x3,
  773. y3,
  774. z3,
  775. msh
  776. })
  777. end
  778. },
  779. Cylinder = {
  780. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  781. local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
  782. prt.Anchored = true
  783. prt.CFrame = cframe
  784. local msh = CFuncs.Mesh.Create("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  785. game:GetService("Debris"):AddItem(prt, 10)
  786. table.insert(Effects, {
  787. prt,
  788. "Cylinder",
  789. delay,
  790. x3,
  791. y3,
  792. z3,
  793. msh
  794. })
  795. end
  796. },
  797. Wave = {
  798. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  799. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  800. prt.Anchored = true
  801. prt.CFrame = cframe
  802. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://20329976", Vector3.new(0, 0, 0), Vector3.new(x1 / 60, y1 / 60, z1 / 60))
  803. game:GetService("Debris"):AddItem(prt, 10)
  804. table.insert(Effects, {
  805. prt,
  806. "Cylinder",
  807. delay,
  808. x3 / 60,
  809. y3 / 60,
  810. z3 / 60,
  811. msh
  812. })
  813. end
  814. },
  815. Ring = {
  816. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  817. local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
  818. prt.Anchored = true
  819. prt.CFrame = cframe
  820. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://3270017", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  821. game:GetService("Debris"):AddItem(prt, 10)
  822. table.insert(Effects, {
  823. prt,
  824. "Cylinder",
  825. delay,
  826. x3,
  827. y3,
  828. z3,
  829. msh
  830. })
  831. end
  832. },
  833. Break = {
  834. Create = function(brickcolor, cframe, x1, y1, z1)
  835. local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
  836. prt.Anchored = true
  837. prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  838. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  839. local num = math.random(10, 50) / 1000
  840. game:GetService("Debris"):AddItem(prt, 10)
  841. table.insert(Effects, {
  842. prt,
  843. "Shatter",
  844. num,
  845. prt.CFrame,
  846. math.random() - math.random(),
  847. 0,
  848. math.random(50, 100) / 100
  849. })
  850. end
  851. },
  852. Spiral = {
  853. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  854. local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
  855. prt.Anchored = true
  856. prt.CFrame = cframe
  857. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://1051557", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  858. game:GetService("Debris"):AddItem(prt, 10)
  859. table.insert(Effects, {
  860. prt,
  861. "Cylinder",
  862. delay,
  863. x3,
  864. y3,
  865. z3,
  866. msh
  867. })
  868. end
  869. },
  870. Push = {
  871. Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  872. local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
  873. prt.Anchored = true
  874. prt.CFrame = cframe
  875. local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://437347603", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  876. game:GetService("Debris"):AddItem(prt, 10)
  877. table.insert(Effects, {
  878. prt,
  879. "Cylinder",
  880. delay,
  881. x3,
  882. y3,
  883. z3,
  884. msh
  885. })
  886. end
  887. }
  888. }
  889. function part(formfactor ,parent, reflectance, transparency, brickcolor, name, size)
  890. local fp = IT("Part")
  891. fp.formFactor = formfactor
  892. fp.Parent = parent
  893. fp.Reflectance = reflectance
  894. fp.Transparency = transparency
  895. fp.CanCollide = false
  896. fp.Locked = true
  897. fp.BrickColor = brickcolor
  898. fp.Name = name
  899. fp.Size = size
  900. fp.Position = tors.Position
  901. RemoveOutlines(fp)
  902. fp.Material = "SmoothPlastic"
  903. fp:BreakJoints()
  904. return fp
  905. end
  906.  
  907. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  908. local mesh = IT(Mesh)
  909. mesh.Parent = part
  910. if Mesh == "SpecialMesh" then
  911. mesh.MeshType = meshtype
  912. if meshid ~= "nil" then
  913. mesh.MeshId = "http://www.roblox.com/asset/?id="..meshid
  914. end
  915. end
  916. mesh.Offset = offset
  917. mesh.Scale = scale
  918. return mesh
  919. end
  920.  
  921. function Magic(bonuspeed, type, pos, scale, value, color, MType)
  922. local type = type
  923. local rng = Instance.new("Part", char)
  924. rng.Anchored = true
  925. rng.BrickColor = color
  926. rng.CanCollide = false
  927. rng.FormFactor = 3
  928. rng.Name = "Ring"
  929. rng.Material = "Neon"
  930. rng.Size = Vector3.new(1, 1, 1)
  931. rng.Transparency = 0
  932. rng.TopSurface = 0
  933. rng.BottomSurface = 0
  934. rng.CFrame = pos
  935. local rngm = Instance.new("SpecialMesh", rng)
  936. rngm.MeshType = MType
  937. rngm.Scale = scale
  938. local scaler2 = 1
  939. if type == "Add" then
  940. scaler2 = 1 * value
  941. elseif type == "Divide" then
  942. scaler2 = 1 / value
  943. end
  944. coroutine.resume(coroutine.create(function()
  945. for i = 0, 10 / bonuspeed, 0.1 do
  946. swait()
  947. if type == "Add" then
  948. scaler2 = scaler2 - 0.01 * value / bonuspeed
  949. elseif type == "Divide" then
  950. scaler2 = scaler2 - 0.01 / value * bonuspeed
  951. end
  952. rng.Transparency = rng.Transparency + 0.01 * bonuspeed
  953. rngm.Scale = rngm.Scale + Vector3.new(scaler2 * bonuspeed, scaler2 * bonuspeed, scaler2 * bonuspeed)
  954. end
  955. rng:Destroy()
  956. end))
  957. end
  958.  
  959. function Eviscerate(dude)
  960. if dude.Name ~= char then
  961. local bgf = IT("BodyGyro", dude.Head)
  962. bgf.CFrame = bgf.CFrame * CFrame.fromEulerAnglesXYZ(Rad(-90), 0, 0)
  963. local val = IT("BoolValue", dude)
  964. val.Name = "IsHit"
  965. local ds = coroutine.wrap(function()
  966. dude:WaitForChild("Head"):BreakJoints()
  967. wait(0.5)
  968. target = nil
  969. coroutine.resume(coroutine.create(function()
  970. for i, v in pairs(dude:GetChildren()) do
  971. if v:IsA("Accessory") then
  972. v:Destroy()
  973. end
  974. if v:IsA("Humanoid") then
  975. v:Destroy()
  976. end
  977. if v:IsA("CharacterMesh") then
  978. v:Destroy()
  979. end
  980. if v:IsA("Model") then
  981. v:Destroy()
  982. end
  983. if v:IsA("Part") or v:IsA("MeshPart") then
  984. for x, o in pairs(v:GetChildren()) do
  985. if o:IsA("Decal") then
  986. o:Destroy()
  987. end
  988. end
  989. coroutine.resume(coroutine.create(function()
  990. v.Material = "Neon"
  991. v.CanCollide = false
  992. local PartEmmit1 = IT("ParticleEmitter", v)
  993. PartEmmit1.LightEmission = 1
  994. PartEmmit1.Texture = "rbxassetid://284205403"
  995. PartEmmit1.Color = ColorSequence.new(maincolor.Color)
  996. PartEmmit1.Rate = 150
  997. PartEmmit1.Lifetime = NumberRange.new(1)
  998. PartEmmit1.Size = NumberSequence.new({
  999. NumberSequenceKeypoint.new(0, 0.75, 0),
  1000. NumberSequenceKeypoint.new(1, 0, 0)
  1001. })
  1002. PartEmmit1.Transparency = NumberSequence.new({
  1003. NumberSequenceKeypoint.new(0, 0, 0),
  1004. NumberSequenceKeypoint.new(1, 1, 0)
  1005. })
  1006. PartEmmit1.Speed = NumberRange.new(0, 0)
  1007. PartEmmit1.VelocitySpread = 30000
  1008. PartEmmit1.Rotation = NumberRange.new(-500, 500)
  1009. PartEmmit1.RotSpeed = NumberRange.new(-500, 500)
  1010. local BodPoss = IT("BodyPosition", v)
  1011. BodPoss.P = 3000
  1012. BodPoss.D = 1000
  1013. BodPoss.maxForce = Vector3.new(50000000000, 50000000000, 50000000000)
  1014. BodPoss.position = v.Position + Vector3.new(Mrandom(-15, 15), Mrandom(-15, 15), Mrandom(-15, 15))
  1015. v.Color = maincolor.Color
  1016. coroutine.resume(coroutine.create(function()
  1017. for i = 0, 49 do
  1018. swait(1)
  1019. v.Transparency = v.Transparency + 0.08
  1020. end
  1021. wait(0.5)
  1022. PartEmmit1.Enabled = false
  1023. wait(3)
  1024. v:Destroy()
  1025. dude:Destroy()
  1026. end))
  1027. end))
  1028. end
  1029. end
  1030. end))
  1031. end)
  1032. ds()
  1033. end
  1034. end
  1035.  
  1036. function FindNearestHead(Position, Distance, SinglePlayer)
  1037. if SinglePlayer then
  1038. return Distance > (SinglePlayer.Torso.CFrame.p - Position).magnitude
  1039. end
  1040. local List = {}
  1041. for i, v in pairs(workspace:GetChildren()) do
  1042. if v:IsA("Model") and v:findFirstChild("Head") and v ~= char and Distance >= (v.Head.Position - Position).magnitude then
  1043. table.insert(List, v)
  1044. end
  1045. end
  1046. return List
  1047. end
  1048.  
  1049. function Aura(bonuspeed, FastSpeed, type, pos, x1, y1, z1, value, color, outerpos, MType)
  1050. local type = type
  1051. local rng = Instance.new("Part", char)
  1052. rng.Anchored = true
  1053. rng.BrickColor = color
  1054. rng.CanCollide = false
  1055. rng.FormFactor = 3
  1056. rng.Name = "Ring"
  1057. rng.Material = "Neon"
  1058. rng.Size = Vector3.new(1, 1, 1)
  1059. rng.Transparency = 0
  1060. rng.TopSurface = 0
  1061. rng.BottomSurface = 0
  1062. rng.CFrame = pos
  1063. rng.CFrame = rng.CFrame + rng.CFrame.lookVector * outerpos
  1064. local rngm = Instance.new("SpecialMesh", rng)
  1065. rngm.MeshType = MType
  1066. rngm.Scale = Vector3.new(x1, y1, z1)
  1067. local scaler2 = 1
  1068. local speeder = FastSpeed
  1069. if type == "Add" then
  1070. scaler2 = 1 * value
  1071. elseif type == "Divide" then
  1072. scaler2 = 1 / value
  1073. end
  1074. coroutine.resume(coroutine.create(function()
  1075. for i = 0, 10 / bonuspeed, 0.1 do
  1076. swait()
  1077. if type == "Add" then
  1078. scaler2 = scaler2 - 0.01 * value / bonuspeed
  1079. elseif type == "Divide" then
  1080. scaler2 = scaler2 - 0.01 / value * bonuspeed
  1081. end
  1082. speeder = speeder - 0.01 * FastSpeed * bonuspeed
  1083. rng.CFrame = rng.CFrame + rng.CFrame.lookVector * speeder * bonuspeed
  1084. rng.Transparency = rng.Transparency + 0.01 * bonuspeed
  1085. rngm.Scale = rngm.Scale + Vector3.new(scaler2 * bonuspeed, scaler2 * bonuspeed, 0)
  1086. end
  1087. rng:Destroy()
  1088. end))
  1089. end
  1090.  
  1091. function SoulSteal(dude)
  1092. if dude.Name ~= char then
  1093. local bgf = IT("BodyGyro", dude.Head)
  1094. bgf.CFrame = bgf.CFrame * CFrame.fromEulerAnglesXYZ(Rad(-90), 0, 0)
  1095. local val = IT("BoolValue", dude)
  1096. val.Name = "IsHit"
  1097. local torso = (dude:FindFirstChild'Head' or dude:FindFirstChild'Torso' or dude:FindFirstChild'UpperTorso' or dude:FindFirstChild'LowerTorso' or dude:FindFirstChild'HumanoidRootPart')
  1098. local soulst = coroutine.wrap(function()
  1099. local soul = Instance.new("Part",dude)
  1100. soul.Size = Vector3.new(1,1,1)
  1101. soul.CanCollide = false
  1102. soul.Anchored = false
  1103. soul.Position = torso.Position
  1104. soul.Transparency = 1
  1105. local PartEmmit1 = IT("ParticleEmitter", soul)
  1106. PartEmmit1.LightEmission = 1
  1107. PartEmmit1.Texture = "rbxassetid://569507414"
  1108. PartEmmit1.Color = ColorSequence.new(maincolor.Color)
  1109. PartEmmit1.Rate = 250
  1110. PartEmmit1.Lifetime = NumberRange.new(1.6)
  1111. PartEmmit1.Size = NumberSequence.new({
  1112. NumberSequenceKeypoint.new(0, 1, 0),
  1113. NumberSequenceKeypoint.new(1, 0, 0)
  1114. })
  1115. PartEmmit1.Transparency = NumberSequence.new({
  1116. NumberSequenceKeypoint.new(0, 0, 0),
  1117. NumberSequenceKeypoint.new(1, 1, 0)
  1118. })
  1119. PartEmmit1.Speed = NumberRange.new(0, 0)
  1120. PartEmmit1.VelocitySpread = 30000
  1121. PartEmmit1.Rotation = NumberRange.new(-360, 360)
  1122. PartEmmit1.RotSpeed = NumberRange.new(-360, 360)
  1123. local BodPoss = IT("BodyPosition", soul)
  1124. BodPoss.P = 3000
  1125. BodPoss.D = 1000
  1126. BodPoss.maxForce = Vector3.new(50000000000, 50000000000, 50000000000)
  1127. BodPoss.position = torso.Position + Vector3.new(Mrandom(-15, 15), Mrandom(-15, 15), Mrandom(-15, 15))
  1128. wait(1.6)
  1129. soul.Touched:connect(function(hit)
  1130. if hit.Parent == char then
  1131. soul:Destroy()
  1132. end
  1133. end)
  1134. wait(1.2)
  1135. while soul do
  1136. swait()
  1137. PartEmmit1.Color = ColorSequence.new(maincolor.Color)
  1138. BodPoss.Position = tors.Position
  1139. end
  1140. end)
  1141. soulst()
  1142. end
  1143. end
  1144. function FaceMouse()
  1145. local Cam = workspace.CurrentCamera
  1146. return {
  1147. CFrame.new(char.Torso.Position, Vector3.new(mouse.Hit.p.x, char.Torso.Position.y, mouse.Hit.p.z)),
  1148. Vector3.new(mouse.Hit.p.x, mouse.Hit.p.y, mouse.Hit.p.z)
  1149. }
  1150. end
  1151. -------------------------------------------------------
  1152. --End Effect Function--
  1153. -------------------------------------------------------
  1154. function Cso(ID, PARENT, VOLUME, PITCH)
  1155. local NSound = nil
  1156. coroutine.resume(coroutine.create(function()
  1157. NSound = IT("Sound", PARENT)
  1158. NSound.Volume = VOLUME
  1159. NSound.Pitch = PITCH
  1160. NSound.SoundId = "http://www.roblox.com/asset/?id="..ID
  1161. swait()
  1162. NSound:play()
  1163. game:GetService("Debris"):AddItem(NSound, 10)
  1164. end))
  1165. return NSound
  1166. end
  1167. function CameraEnshaking(Length, Intensity)
  1168. coroutine.resume(coroutine.create(function()
  1169. local intensity = 1 * Intensity
  1170. local rotM = 0.01 * Intensity
  1171. for i = 0, Length, 0.1 do
  1172. swait()
  1173. intensity = intensity - 0.05 * Intensity / Length
  1174. rotM = rotM - 5.0E-4 * Intensity / Length
  1175. hum.CameraOffset = Vector3.new(Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity)))
  1176. cam.CFrame = cam.CFrame * CF(Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity))) * Euler(Rad(Mrandom(-intensity, intensity)) * rotM, Rad(Mrandom(-intensity, intensity)) * rotM, Rad(Mrandom(-intensity, intensity)) * rotM)
  1177. end
  1178. hum.CameraOffset = Vector3.new(0, 0, 0)
  1179. end))
  1180. end
  1181.  
  1182. function getRegion(point,range,ignore)
  1183. return workspace:FindPartsInRegion3WithIgnoreList(Region3.new(point-Vector3.new(1,1,1)*range/2,point+Vector3.new(1,1,1)*range/2),ignore,100)
  1184. end
  1185.  
  1186. function GetTorso(chars)
  1187. return chars:FindFirstChild'Torso' or chars:FindFirstChild'UpperTorso'
  1188. end
  1189.  
  1190. function ClosestHumanoid(pos,range)
  1191. local mag,closest = math.huge;
  1192. for _,v in next, getRegion(pos,range or 10,{char}) do
  1193. local hum = (v.Parent and v.Parent:FindFirstChildOfClass'Humanoid')
  1194. if((v.CFrame.p-pos).magnitude < mag and hum and closest ~= hum and hum.Health > 0)then
  1195. mag = (v.CFrame.p-pos).magnitude
  1196. closest = hum
  1197. end
  1198. end
  1199. return closest,(closest and GetTorso(closest.Parent) or nil)
  1200. end
  1201.  
  1202. for _,v in pairs (char:children()) do
  1203. if v:IsA("Accessory") or v:IsA("Hat") then
  1204. v:Destroy()
  1205. end
  1206. end
  1207. -------------------------------------------------------
  1208. --Start Customization--
  1209. -------------------------------------------------------
  1210. local Player_Size = 0.6
  1211. if Player_Size ~= 1 then
  1212. root.Size = root.Size * Player_Size
  1213. tors.Size = tors.Size * Player_Size
  1214. hed.Size = hed.Size * Player_Size
  1215. ra.Size = ra.Size * Player_Size
  1216. la.Size = la.Size * Player_Size
  1217. rl.Size = rl.Size * Player_Size
  1218. ll.Size = ll.Size * Player_Size
  1219. ----------------------------------------------------------------------------------
  1220. rootj.Parent = root
  1221. neck.Parent = tors
  1222. RW.Parent = tors
  1223. LW.Parent = tors
  1224. RH.Parent = tors
  1225. LH.Parent = tors
  1226. ----------------------------------------------------------------------------------
  1227. rootj.C0 = RootCF * CF(0 * Player_Size, 0 * Player_Size, 0 * Player_Size) * angles(Rad(0), Rad(0), Rad(0))
  1228. rootj.C1 = RootCF * CF(0 * Player_Size, 0 * Player_Size, 0 * Player_Size) * angles(Rad(0), Rad(0), Rad(0))
  1229. neck.C0 = necko * CF(0 * Player_Size, 0 * Player_Size, 0 + ((1 * Player_Size) - 1)) * angles(Rad(0), Rad(0), Rad(0))
  1230. neck.C1 = CF(0 * Player_Size, -0.5 * Player_Size, 0 * Player_Size) * angles(Rad(-90), Rad(0), Rad(180))
  1231. RW.C0 = CF(1.5 * Player_Size, 0.5 * Player_Size, 0 * Player_Size) * angles(Rad(0), Rad(0), Rad(0)) --* RIGHTSHOULDERC0
  1232. LW.C0 = CF(-1.5 * Player_Size, 0.5 * Player_Size, 0 * Player_Size) * angles(Rad(0), Rad(0), Rad(0)) --* LEFTSHOULDERC0
  1233. ----------------------------------------------------------------------------------
  1234. RH.C0 = CF(1 * Player_Size, -1 * Player_Size, 0 * Player_Size) * angles(Rad(0), Rad(90), Rad(0)) * angles(Rad(0), Rad(0), Rad(0))
  1235. LH.C0 = CF(-1 * Player_Size, -1 * Player_Size, 0 * Player_Size) * angles(Rad(0), Rad(-90), Rad(0)) * angles(Rad(0), Rad(0), Rad(0))
  1236. RH.C1 = CF(0.5 * Player_Size, 1 * Player_Size, 0 * Player_Size) * angles(Rad(0), Rad(90), Rad(0)) * angles(Rad(0), Rad(0), Rad(0))
  1237. LH.C1 = CF(-0.5 * Player_Size, 1 * Player_Size, 0 * Player_Size) * angles(Rad(0), Rad(-90), Rad(0)) * angles(Rad(0), Rad(0), Rad(0))
  1238. --hat.Parent = Character
  1239. end
  1240. ----------------------------------------------------------------------------------
  1241. local SONG = 0
  1242. local SONG2 = 0
  1243. local Music = Instance.new("Sound",tors)
  1244. Music.Volume = 2.5
  1245. Music.Looped = true
  1246. Music.Pitch = 1 --Pitcher
  1247. ----------------------------------------------------------------------------------
  1248. local equipped = false
  1249. local idle = 0
  1250. local change = 1
  1251. local val = 0
  1252. local toim = 0
  1253. local idleanim = 0.4
  1254. local sine = 0
  1255. local Sit = 1
  1256. local VALUE1 = false
  1257. local VALUE2 = false
  1258. ----------------------------------------------------------------------------------
  1259. hum.WalkSpeed = 10
  1260. hum.JumpPower = 50
  1261. hum.Animator.Parent = nil
  1262. -------------------------------------------------------
  1263. --End Customization--
  1264. -------------------------------------------------------
  1265.  
  1266. attack = false
  1267.  
  1268. function slash()
  1269. attack = true
  1270. for i = 0, 1.6, 0.1 do
  1271. swait()
  1272. rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.05 + 0.05 * Cos(sine / 12)) * angles(Rad(0), Rad(0), Rad(0)), 0.15)
  1273. tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-2.5), Rad(0), Rad(0)), 0.3)
  1274. RH.C0 = clerp(RH.C0, CF(1 * Player_Size, -0.6 - 0.1 * Player_Size * Cos(sine / 12), 0.025 * Player_Size * Cos(sine / 20)) * RHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15)
  1275. LH.C0 = clerp(LH.C0, CF(-1 * Player_Size, -0.6 - 0.1 * Player_Size * Cos(sine / 12), 0.025 * Player_Size * Cos(sine / 20)) * LHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15)
  1276. RW.C0 = clerp(RW.C0, CF(1.5 * Player_Size, 0.5 + 0.05 * Player_Size * Sin(sine / 30), 0.025 * Player_Size * Cos(sine / 20)) * angles(Rad(-75), Rad(0), Rad(75)), 0.1)
  1277. LW.C0 = clerp(LW.C0, CF(-1.5 * Player_Size, 0.5 + 0.05 * Player_Size * Sin(sine / 30), 0.025 * Player_Size * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(-5 + -2 * Cos(sine / 12))), 0.1)
  1278. end
  1279. HitboxFunction(ra.CFrame, 0.01, 0.5, 0.5, 0.5, 7, 18, 18, 3, "Normal")
  1280. for i = 0, 1.6, 0.1 do
  1281. swait()
  1282. rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.05 + 0.05 * Cos(sine / 12)) * angles(Rad(0), Rad(0), Rad(0)), 0.15)
  1283. tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-2.5), Rad(0), Rad(0)), 0.3)
  1284. RH.C0 = clerp(RH.C0, CF(1 * Player_Size, -0.6 - 0.1 * Player_Size * Cos(sine / 12), 0.025 * Player_Size * Cos(sine / 20)) * RHCF * angles(Rad(-2.5), Rad(0), Rad(-3)), 0.15)
  1285. LH.C0 = clerp(LH.C0, CF(-1 * Player_Size, -0.6 - 0.1 * Player_Size * Cos(sine / 12), 0.025 * Player_Size * Cos(sine / 20)) * LHCF * angles(Rad(-2.5), Rad(0), Rad(3)), 0.15)
  1286. RW.C0 = clerp(RW.C0, CF(1.5 * Player_Size, 0.5 + 0.05 * Player_Size * Sin(sine / 30), 0.025 * Player_Size * Cos(sine / 20)) * angles(Rad(75), Rad(0), Rad(-75)), 0.1)
  1287. LW.C0 = clerp(LW.C0, CF(-1.5 * Player_Size, 0.5 + 0.05 * Player_Size * Sin(sine / 30), 0.025 * Player_Size * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(-5 + -2 * Cos(sine / 12))), 0.1)
  1288. end
  1289. attack = false
  1290. end
  1291.  
  1292. -------------------------------------------------------
  1293. --Start Animations--
  1294. -------------------------------------------------------
  1295. print("By me")
  1296. while true do
  1297. swait()
  1298. sine = sine + change
  1299. local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude
  1300. local velderp = root.Velocity.y
  1301. hitfloor, posfloor = rayCast(root.Position, CFrame.new(root.Position, root.Position - Vector3.new(0, 1, 0)).lookVector, 4* Player_Size, char)
  1302. if equipped == true or equipped == false then
  1303. if attack == false then
  1304. idle = idle + 1
  1305. else
  1306. idle = 0
  1307. end
  1308. if 1 < root.Velocity.y and hitfloor == nil then
  1309. Anim = "Jump"
  1310. if attack == false then
  1311. rootj.C0 = clerp(rootj.C0, RootCF * CF(0* Player_Size, 0* Player_Size, -0.1 + 0.1 * Cos(sine / 20)* Player_Size) * angles(Rad(-16), Rad(0), Rad(0)), 0.1)
  1312. neck.C0 = clerp(neck.C0, necko* CF(0, 0, 0 + ((1* Player_Size) - 1)) * angles(Rad(10 - 2.5 * Sin(sine / 30)), Rad(0), Rad(0)), 0.3)
  1313. RH.C0 = clerp(RH.C0, CF(1* Player_Size, -.2 - 0.1 * Cos(sine / 20)* Player_Size, -.3* Player_Size) * RHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.1)
  1314. LH.C0 = clerp(LH.C0, CF(-1* Player_Size, -.9 - 0.1 * Cos(sine / 20), -.5* Player_Size) * LHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.1)
  1315. RW.C0 = clerp(RW.C0, CF(1.5* Player_Size, 0.5 + 0.02 * Sin(sine / 20)* Player_Size, 0* Player_Size) * angles(Rad(25), Rad(-.6), Rad(13 + 4.5 * Sin(sine / 20))), 0.1)
  1316. LW.C0 = clerp(LW.C0, CF(-1.5* Player_Size, 0.5 + 0.02 * Sin(sine / 20)* Player_Size, 0* Player_Size) * angles(Rad(25), Rad(-.6), Rad(-13 - 4.5 * Sin(sine / 20))), 0.1)
  1317. end
  1318. elseif -1 > root.Velocity.y and hitfloor == nil then
  1319. Anim = "Fall"
  1320. if attack == false then
  1321. rootj.C0 = clerp(rootj.C0, RootCF * CF(0* Player_Size, 0* Player_Size, -0.1 + 0.1 * Cos(sine / 20)* Player_Size) * angles(Rad(24), Rad(0), Rad(0)), 0.1)
  1322. neck.C0 = clerp(neck.C0, necko* CF(0, 0, 0 + ((1* Player_Size) - 1)) * angles(Rad(10 - 2.5 * Sin(sine / 30)), Rad(0), Rad(0)), 0.3)
  1323. RH.C0 = clerp(RH.C0, CF(1* Player_Size, -1 - 0.1 * Cos(sine / 20)* Player_Size, -.3* Player_Size) * RHCF * angles(Rad(-3.5), Rad(0), Rad(0)), 0.1)
  1324. LH.C0 = clerp(LH.C0, CF(-1* Player_Size, -.8 - 0.1 * Cos(sine / 20)* Player_Size, -.3* Player_Size) * LHCF * angles(Rad(-3.5), Rad(0), Rad(0)), 0.1)
  1325. RW.C0 = clerp(RW.C0, CF(1.5* Player_Size, 0.5 + 0.02 * Sin(sine / 20)* Player_Size, 0* Player_Size) * angles(Rad(65), Rad(-.6), Rad(45 + 4.5 * Sin(sine / 20))), 0.1)
  1326. LW.C0 = clerp(LW.C0, CF(-1.5* Player_Size, 0.5 + 0.02 * Sin(sine / 20)* Player_Size, 0* Player_Size) * angles(Rad(55), Rad(-.6), Rad(-45 - 4.5 * Sin(sine / 20))), 0.1)
  1327. end
  1328. elseif torvel < 1 and hitfloor ~= nil then
  1329. Anim = "Idle"
  1330. change = 1
  1331. if attack == false then
  1332. rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, 0 + 0 * Cos(sine / 12)) * angles(Rad(0), Rad(0), Rad(0)), 0.15)
  1333. tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-4.25), Rad(0), Rad(0)), 0.3)
  1334. RH.C0 = clerp(RH.C0, CF(1 * Player_Size, -0.6 - 0 * Player_Size * Cos(sine / 12), 0.025 * Player_Size * Cos(sine / 20)) * RHCF * angles(Rad(0), Rad(0), Rad(-2.5)), 0.15)
  1335. LH.C0 = clerp(LH.C0, CF(-1 * Player_Size, -0.6 - 0 * Player_Size * Cos(sine / 12), 0.025 * Player_Size * Cos(sine / 20)) * LHCF * angles(Rad(0), Rad(-2.5), Rad(-0.15)), 0.15)
  1336. RW.C0 = clerp(RW.C0, CF(1.5 * Player_Size, 0.5 * Player_Size, 0.25 * Player_Size) * angles(Rad(90), Rad(0), Rad(0)), 0.1)
  1337. LW.C0 = clerp(LW.C0, CF(-1.5 * Player_Size, 0.5 * Player_Size, 0.25 * Player_Size) * angles(Rad(90), Rad(0), Rad(0)), 0.1)
  1338. end
  1339. elseif tors.Velocity.magnitude < 50 and hitfloor ~= nil then
  1340. Anim = "Walk"
  1341. change = 1
  1342. if attack == false then
  1343. rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, 0 + 0 * Cos(sine / 12)) * angles(Rad(0), Rad(0), Rad(0)), 0.15)
  1344. tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-4.25), Rad(0), Rad(0)), 0.3)
  1345. RH.C0 = clerp(RH.C0, CF(1 * Player_Size, -0.6 - 0 * Player_Size , 0.025 * Player_Size * Cos(sine / 20)) * RHCF * angles(Rad(0), Rad(0), Rad(0 + 50 * Cos(sine / 7))), 0.15)
  1346. LH.C0 = clerp(LH.C0, CF(-1 * Player_Size, -0.6 - 0 * Player_Size , 0.025 * Player_Size * Cos(sine / 20)) * LHCF * angles(Rad(0), Rad(0), Rad(0 + 50 * Cos(sine / 7))), 0.15)
  1347. RW.C0 = clerp(RW.C0, CF(1.5 * Player_Size, 0.5 * Player_Size, 0.25 * Player_Size) * angles(Rad(90), Rad(0), Rad(0)), 0.1)
  1348. LW.C0 = clerp(LW.C0, CF(-1.5 * Player_Size, 0.5 * Player_Size, 0.25 * Player_Size) * angles(Rad(90), Rad(0), Rad(0)), 0.1)
  1349. end
  1350. end
  1351. end
  1352. Music.SoundId = "rbxassetid://"..SONG
  1353. Music.Looped = true
  1354. Music.Pitch = 1
  1355. Music.Volume = 5
  1356. Music.Parent = tors
  1357. Music:Resume()
  1358. if 0 < #Effects then
  1359. for e = 1, #Effects do
  1360. if Effects[e] ~= nil then
  1361. local Thing = Effects[e]
  1362. if Thing ~= nil then
  1363. local Part = Thing[1]
  1364. local Mode = Thing[2]
  1365. local Delay = Thing[3]
  1366. local IncX = Thing[4]
  1367. local IncY = Thing[5]
  1368. local IncZ = Thing[6]
  1369. if 1 >= Thing[1].Transparency then
  1370. if Thing[2] == "Block1" then
  1371. Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  1372. local Mesh = Thing[1].Mesh
  1373. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  1374. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1375. elseif Thing[2] == "Block2" then
  1376. Thing[1].CFrame = Thing[1].CFrame + Vector3.new(0, 0, 0)
  1377. local Mesh = Thing[7]
  1378. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  1379. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1380. elseif Thing[2] == "Block3" then
  1381. Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) + Vector3.new(0, 0.15, 0)
  1382. local Mesh = Thing[7]
  1383. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  1384. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1385. elseif Thing[2] == "Cylinder" then
  1386. local Mesh = Thing[1].Mesh
  1387. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  1388. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1389. elseif Thing[2] == "Blood" then
  1390. local Mesh = Thing[7]
  1391. Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, 0.5, 0)
  1392. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  1393. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1394. elseif Thing[2] == "Elec" then
  1395. local Mesh = Thing[1].Mesh
  1396. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9])
  1397. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1398. elseif Thing[2] == "Disappear" then
  1399. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1400. elseif Thing[2] == "Shatter" then
  1401. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1402. Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0)
  1403. Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
  1404. Thing[6] = Thing[6] + Thing[5]
  1405. end
  1406. else
  1407. Part.Parent = nil
  1408. table.remove(Effects, e)
  1409. end
  1410. end
  1411. end
  1412. end
  1413. end
  1414. end
  1415. -------------------------------------------------------
  1416. --End Animations And Script--
  1417. -------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement