Advertisement
hjkook

ddd

Mar 8th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.70 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
  5.  
  6. wait(0.1)
  7. local plr = owner
  8. local mouse = plr:GetMouse()
  9. local PlayerGui = Player.PlayerGui
  10. local Cam = workspace.CurrentCamera
  11. local Backpack = Player.Backpack
  12. local Character = Player.Character
  13. local Humanoid = Character.Humanoid
  14. local RootPart = Character["HumanoidRootPart"]
  15. local Torso = Character["Torso"]
  16. local Head = Character["Head"]
  17. local RightArm = Character["Right Arm"]
  18. local LeftArm = Character["Left Arm"]
  19. local RightLeg = Character["Right Leg"]
  20. local LeftLeg = Character["Left Leg"]
  21. local RootJoint = RootPart["RootJoint"]
  22. local Neck = Torso["Neck"]
  23. local RightShoulder = Torso["Right Shoulder"]
  24. local LeftShoulder = Torso["Left Shoulder"]
  25. local RightHip = Torso["Right Hip"]
  26. local LeftHip = Torso["Left Hip"]
  27. --음원관련
  28.  
  29.  
  30. local S = IT("Sound")
  31. function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
  32. local NEWSOUND = nil
  33. coroutine.resume(coroutine.create(function()
  34. NEWSOUND = S:Clone()
  35. NEWSOUND.Parent = PARENT
  36. NEWSOUND.Volume = VOLUME
  37. NEWSOUND.Pitch = PITCH
  38. NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
  39. NEWSOUND:play()
  40. NEWSOUND.Name = "Audio"
  41. if DOESLOOP == true then
  42. NEWSOUND.Looped = true
  43. else
  44. repeat Swait() until NEWSOUND.Playing == false
  45. NEWSOUND:remove()
  46. end
  47. end))
  48. return NEWSOUND
  49. end
  50. --함수관련
  51. IT = Instance.new
  52. CF = CFrame.new
  53. VT = Vector3.new
  54. RAD = math.rad
  55. C3 = Color3.new
  56. UD2 = UDim2.new
  57. BRICKC = BrickColor.new
  58. ANGLES = CFrame.Angles
  59. EULER = CFrame.fromEulerAnglesXYZ
  60. COS = math.cos
  61. ACOS = math.acos
  62. SIN = math.sin
  63. ASIN = math.asin
  64. ABS = math.abs
  65. MRANDOM = math.random
  66. FLOOR = math.floor
  67. --//=================================\\
  68. --|| USEFUL VALUES
  69. --\\=================================//
  70.  
  71. Animation_Speed = 3
  72. Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
  73. local Speed = 45
  74. local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  75. local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  76. local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
  77. local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
  78. local DAMAGEMULTIPLIER = 1
  79. local ANIM = "Idle"
  80. local ATTACK = false
  81. local EQUIPPED = false
  82. local HOLD = false
  83. local COMBO = 1
  84. local Rooted = false
  85. local SINE = 0
  86. local KEYHOLD = false
  87. local CHANGE = 2 / Animation_Speed
  88. local WALKINGANIM = false
  89. local VALUE1 = false
  90. local VALUE2 = false
  91. local ROBLOXIDLEANIMATION = IT("Animation")
  92. ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
  93. ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  94. --ROBLOXIDLEANIMATION.Parent = Humanoid
  95. local WEAPONGUI = IT("ScreenGui", PlayerGui)
  96. WEAPONGUI.Name = "Weapon GUI"
  97. local Effects = IT("Folder", Character)
  98. Effects.Name = "Effects"
  99. local ANIMATOR = Humanoid.Animator
  100. local ANIMATE = Character.Animate
  101. local UNANCHOR = true
  102. local HITPOS = nil
  103. local HITFLOOR = nil
  104. local LEFTWINGS = {}
  105. local RIGHTWINGS = {}
  106. local BODY = {}
  107. --//=================================\\
  108. --|| SAZERENOS' ARTIFICIAL HEARTBEAT
  109. --\\=================================//
  110.  
  111. ArtificialHB = Instance.new("BindableEvent", script)
  112. ArtificialHB.Name = "ArtificialHB"
  113.  
  114. script:WaitForChild("ArtificialHB")
  115.  
  116. frame = Frame_Speed
  117. tf = 0
  118. allowframeloss = false
  119. tossremainder = false
  120. lastframe = tick()
  121. script.ArtificialHB:Fire()
  122.  
  123. game:GetService("RunService").Heartbeat:connect(function(s, p)
  124. tf = tf + s
  125. if tf >= frame then
  126. if allowframeloss then
  127. script.ArtificialHB:Fire()
  128. lastframe = tick()
  129. else
  130. for i = 1, math.floor(tf / frame) do
  131. script.ArtificialHB:Fire()
  132. end
  133. lastframe = tick()
  134. end
  135. if tossremainder then
  136. tf = 0
  137. else
  138. tf = tf - frame * math.floor(tf / frame)
  139. end
  140. end
  141. end)
  142. --각종함수
  143. function Swait(NUMBER)
  144. if NUMBER == 0 or NUMBER == nil then
  145. ArtificialHB.Event:wait()
  146. else
  147. for i = 1, NUMBER do
  148. ArtificialHB.Event:wait()
  149. end
  150. end
  151. end
  152. --?
  153. function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  154. local NEWPART = IT("Part")
  155. NEWPART.formFactor = FORMFACTOR
  156. NEWPART.Reflectance = REFLECTANCE
  157. NEWPART.Transparency = TRANSPARENCY
  158. NEWPART.CanCollide = false
  159. NEWPART.Locked = true
  160. NEWPART.Anchored = true
  161. if ANCHOR == false then
  162. NEWPART.Anchored = false
  163. end
  164. NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
  165. NEWPART.Name = NAME
  166. NEWPART.Size = SIZE
  167. NEWPART.Position = Torso.Position
  168. NEWPART.Material = MATERIAL
  169. NEWPART:BreakJoints()
  170. NEWPART.Parent = PARENT
  171. return NEWPART
  172. end
  173. --?2
  174. function Clerp(a, b, t)
  175. local qa = {QuaternionFromCFrame(a)}
  176. local qb = {QuaternionFromCFrame(b)}
  177. local ax, ay, az = a.x, a.y, a.z
  178. local bx, by, bz = b.x, b.y, b.z
  179. local _t = 1 - t
  180. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  181. end
  182. --공격
  183. function CyberSmash()
  184. ATTACK = true
  185. Rooted = false
  186. local GYRO = IT("BodyGyro",RootPart)
  187. GYRO.D = 100
  188. GYRO.P = 2000
  189. GYRO.MaxTorque = VT(0,4000000,0)
  190. GYRO.cframe = CF(RootPart.Position,mouse.Hit.p)
  191. local SMASH = CreatePart(3, Effects, "Neon", 0, 1, "Really red", "Block", VT(25,25,25))
  192. SMASH.CanCollide = true
  193. SMASH.Color = C3(0,0,0)
  194. local EF = Instance.new("SelectionBox",SMASH)
  195. EF.Adornee = SMASH
  196. EF.Color = BrickColor.new("Really red")
  197. EF.LineThickness = 0.2
  198. EF.Transparency = 1
  199. coroutine.resume(coroutine.create(function()
  200. for i = 1, 20 do
  201. Swait()
  202. SMASH.Transparency = SMASH.Transparency - 0.05
  203. EF.Transparency = SMASH.Transparency
  204. end
  205. end))
  206. repeat
  207. SMASH.CFrame = CF(mouse.Hit.p)*CF(0,35,0)
  208. Swait()
  209. GYRO.cframe = CF(RootPart.Position,SMASH.Position)
  210. RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.25 * COS(SINE / 12)) * ANGLES(RAD(-15 + 2.5 * SIN(SINE / 12)), RAD(0), RAD(45)), 1 / Animation_Speed)
  211. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 + 4.5 * SIN(SINE / 12)), RAD(0), RAD(-45 - 4 * SIN(SINE / 12))), 1 / Animation_Speed)
  212. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5 + 0.025 * COS(SINE / 12), -0.5) * ANGLES(RAD(130), RAD(0 - 7.5 * SIN(SINE / 12)), RAD(45 + 7.5 * SIN(SINE / 12))) * RIGHTSHOULDERC0, 1 / Animation_Speed)
  213. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.025 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(0 + 7.5 * SIN(SINE / 12)), RAD(-12 - 7.5 * SIN(SINE / 12))) * LEFTSHOULDERC0, 1 / Animation_Speed)
  214. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.01) * ANGLES(RAD(7.5 * SIN(SINE / 12)), RAD(75), RAD(0)) * ANGLES(RAD(-8 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
  215. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -0.5, -0.5) * ANGLES(RAD(7.5 * SIN(SINE / 12)), RAD(-90), RAD(0)) * ANGLES(RAD(-8 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
  216. until HOLD == true and SMASH.Transparency < 0.99
  217. for i = 1, 25 do
  218. Swait()
  219. SMASH.CFrame = SMASH.CFrame*CF(0,15/25,0)
  220. RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.25 * COS(SINE / 12)) * ANGLES(RAD(-25 + 2.5 * SIN(SINE / 12)), RAD(0), RAD(45)), 1 / Animation_Speed)
  221. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 + 4.5 * SIN(SINE / 12)), RAD(0), RAD(-45 - 4 * SIN(SINE / 12))), 1 / Animation_Speed)
  222. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.75 + 0.025 * COS(SINE / 12), -0.5) * ANGLES(RAD(160), RAD(0 - 7.5 * SIN(SINE / 12)), RAD(45 + 7.5 * SIN(SINE / 12))) * RIGHTSHOULDERC0, 1 / Animation_Speed)
  223. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.025 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(0 + 7.5 * SIN(SINE / 12)), RAD(-12 - 7.5 * SIN(SINE / 12))) * LEFTSHOULDERC0, 1 / Animation_Speed)
  224. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.01) * ANGLES(RAD(7.5 * SIN(SINE / 12)), RAD(75), RAD(0)) * ANGLES(RAD(-8 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
  225. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -0.5, -0.5) * ANGLES(RAD(7.5 * SIN(SINE / 12)), RAD(-90), RAD(0)) * ANGLES(RAD(-8 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
  226. end
  227. local TOCH = SMASH.Touched:Connect(function(hit)
  228. if hit.Anchored == false and hit.Parent ~= Head and hit.Parent ~= Character and hit.Parent ~= Effects then
  229. Shatter(hit)
  230. end
  231. end)
  232. local n0 = nil
  233. local HITFLOOR,HITPOS = Raycast(SMASH.Position, (CF(SMASH.Position, SMASH.Position + VT(0, -1, 0))).lookVector, 25000, Character)
  234. if HITFLOOR ~= nil then
  235. if HITFLOOR.Anchored == false and HITFLOOR.Parent ~= workspace then
  236. if HITFLOOR.Parent:FindFirstChildOfClass("Humanoid") or HITFLOOR.Parent.Parent:FindFirstChildOfClass("Humanoid") then
  237. if HITFLOOR.Parent.ClassName == "Model" then
  238. HITFLOOR.Parent:BreakJoints()
  239. elseif HITFLOOR.Parent.Parent.ClassName == "Model" then
  240. HITFLOOR.Parent.Parent:BreakJoints()
  241. end
  242. end
  243. local POS = HITPOS
  244. n0,HITPOS = Raycast(POS, (CF(POS, POS + VT(0, -1, 0))).lookVector, 25000, HITFLOOR.Parent)
  245. end
  246. end
  247. killnearest(HITPOS,SMASH.Size.X/1.3,"Shatter")
  248. SMASH.CFrame = CF(HITPOS+VT(0,SMASH.Size.Y/2,0))
  249. WACKYEFFECT({Time = 25, EffectType = "Box", Size = VT(24,0,24), Size2 = VT(75,2,75), Transparency = 0, Transparency2 = 1, CFrame = CF(HITPOS), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SKILLTEXTCOLOR, SoundID = 130972023, SoundPitch = 1, SoundVolume = 10})
  250. for i = 1, 25 do
  251. Swait()
  252. RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.25 * COS(SINE / 12)) * ANGLES(RAD(25 + 2.5 * SIN(SINE / 12)), RAD(0), RAD(45)), 1 / Animation_Speed)
  253. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 + 4.5 * SIN(SINE / 12)), RAD(0), RAD(-45 - 4 * SIN(SINE / 12))), 1 / Animation_Speed)
  254. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5 + 0.025 * COS(SINE / 12), -0.5) * ANGLES(RAD(30), RAD(0 - 7.5 * SIN(SINE / 12)), RAD(45 + 7.5 * SIN(SINE / 12))) * RIGHTSHOULDERC0, 1 / Animation_Speed)
  255. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.025 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(0 + 7.5 * SIN(SINE / 12)), RAD(-12 - 7.5 * SIN(SINE / 12))) * LEFTSHOULDERC0, 1 / Animation_Speed)
  256. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.01) * ANGLES(RAD(7.5 * SIN(SINE / 12)), RAD(75), RAD(0)) * ANGLES(RAD(-8 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
  257. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -0.5, -0.5) * ANGLES(RAD(7.5 * SIN(SINE / 12)), RAD(-90), RAD(0)) * ANGLES(RAD(-8 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
  258. end
  259. coroutine.resume(coroutine.create(function()
  260. wait(0.2)
  261. TOCH:disconnect()
  262. wait(1.8)
  263. for i = 1, 100 do
  264. Swait()
  265. SMASH.Transparency = i/100
  266. end
  267. for i = 1, 10 do
  268. Swait()
  269. EF.Transparency = EF.Transparency + 0.1
  270. end
  271. SMASH:remove()
  272. end))
  273. GYRO:remove()
  274. ATTACK = false
  275. Rooted = false
  276. end
  277. --아래
  278. function QuaternionFromCFrame(cf)
  279. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  280. local trace = m00 + m11 + m22
  281. if trace > 0 then
  282. local s = math.sqrt(1 + trace)
  283. local recip = 0.5 / s
  284. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  285. else
  286. local i = 0
  287. if m11 > m00 then
  288. i = 1
  289. end
  290. if m22 > (i == 0 and m00 or m11) then
  291. i = 2
  292. end
  293. if i == 0 then
  294. local s = math.sqrt(m00 - m11 - m22 + 1)
  295. local recip = 0.5 / s
  296. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  297. elseif i == 1 then
  298. local s = math.sqrt(m11 - m22 - m00 + 1)
  299. local recip = 0.5 / s
  300. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  301. elseif i == 2 then
  302. local s = math.sqrt(m22 - m00 - m11 + 1)
  303. local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  304. end
  305. end
  306. end
  307. --...
  308. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  309. local xs, ys, zs = x + x, y + y, z + z
  310. local wx, wy, wz = w * xs, w * ys, w * zs
  311. local xx = x * xs
  312. local xy = x * ys
  313. local xz = x * zs
  314. local yy = y * ys
  315. local yz = y * zs
  316. local zz = z * zs
  317. 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))
  318. end
  319.  
  320. function QuaternionSlerp(a, b, t)
  321. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  322. local startInterp, finishInterp;
  323. if cosTheta >= 0.0001 then
  324. if (1 - cosTheta) > 0.0001 then
  325. local theta = ACOS(cosTheta)
  326. local invSinTheta = 1 / SIN(theta)
  327. startInterp = SIN((1 - t) * theta) * invSinTheta
  328. finishInterp = SIN(t * theta) * invSinTheta
  329. else
  330. startInterp = 1 - t
  331. finishInterp = t
  332. end
  333. else
  334. if (1 + cosTheta) > 0.0001 then
  335. local theta = ACOS(-cosTheta)
  336. local invSinTheta = 1 / SIN(theta)
  337. startInterp = SIN((t - 1) * theta) * invSinTheta
  338. finishInterp = SIN(t * theta) * invSinTheta
  339. else
  340. startInterp = t - 1
  341. finishInterp = t
  342. end
  343. end
  344. 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
  345. end
  346. --S3RL
  347. function Shatter(Part)
  348. if Part.Transparency == 0 then
  349. local SOUNDPART = CreatePart(3, Effects, "Neon", 0, 1, Part.BrickColor, "OOF", VT(0,0,0))
  350. Debris:AddItem(SOUNDPART,5)
  351. CreateSound("84005018", SOUNDPART, 3, MRANDOM(8,12)/10, false)
  352. local SIZE = Part.Size.X + Part.Size.Y + Part.Size.Z
  353. local SIZESET = SIZE/4
  354. local XOffset = Part.Size.X*1.5/SIZESET
  355. local YOffset = Part.Size.Y*1.5/SIZESET
  356. local ZOffset = Part.Size.Z*1.5/SIZESET
  357. for x = 1, math.ceil(XOffset) do
  358. for y = 1, math.ceil(YOffset) do
  359. for z = 1, math.ceil(ZOffset) do
  360. local SHARD = CreatePart(3, Effects, "Neon", 0, 0, Part.BrickColor, "Shard", VT(SIZE,SIZE,SIZE)/10, false)
  361. SHARD.CanCollide = true
  362. SHARD.CFrame = Part.CFrame*CF((Part.Size.X/2-x/4),(Part.Size.Y/2-y/4),(Part.Size.Z/2-z/4))
  363. SHARD.Velocity = VT(MRANDOM(-15,15),MRANDOM(-15,15),MRANDOM(-15,15))*3
  364. Debris:AddItem(SHARD,MRANDOM(10,25)/3)
  365. end
  366. end
  367. end
  368. end
  369. Part:remove()
  370. end
  371.  
  372. function MakeForm(PART,TYPE)
  373. if TYPE == "Cyl" then
  374. local MSH = IT("CylinderMesh",PART)
  375. elseif TYPE == "Ball" then
  376. local MSH = IT("SpecialMesh",PART)
  377. MSH.MeshType = "Sphere"
  378. elseif TYPE == "Wedge" then
  379. local MSH = IT("SpecialMesh",PART)
  380. MSH.MeshType = "Wedge"
  381. end
  382. end
  383.  
  384. Debris = game:GetService("Debris")
  385.  
  386. function CastProperRay(StartPos, EndPos, Distance, Ignore)
  387. local DIRECTION = CF(StartPos,EndPos).lookVector
  388. return Raycast(StartPos, DIRECTION, Distance, Ignore)
  389. end
  390.  
  391. function turnto(position)
  392. RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0)
  393. end
  394. --/FUCK/I WORK
  395. function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
  396. return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
  397. end
  398. --...
  399. --//=================================\\
  400. --|| DAMAGING
  401. --\\=================================//
  402.  
  403. function killnearest(position,range,EFFECT)
  404. for i,v in ipairs(workspace:GetChildren()) do
  405. local body = v:GetChildren()
  406. for part = 1, #body do
  407. if((body[part].ClassName == "Part" or body[part].ClassName == "MeshPart") and v ~= Character) then
  408. local SIZE = body[part].Size.Magnitude
  409. if(body[part].Position - position).Magnitude < range + SIZE/2 then
  410. if v.ClassName == "Model" then
  411. if v:FindFirstChildOfClass("Humanoid") ~= nil then
  412. if v:FindFirstChildOfClass("Humanoid").Health > 0 then
  413. v:BreakJoints()
  414. if EFFECT == "Glitch" then
  415. coroutine.resume(coroutine.create(function()
  416. local ORIGINPOS = body[part].CFrame
  417. local SIZE = body[part].Size
  418. for i = 1, 100 do
  419. Swait()
  420. local PART = body[part]
  421. PART.Anchored = true
  422. PART.Size = SIZE*MRANDOM(5,15)/10
  423. PART.CFrame = ORIGINPOS*CF(MRANDOM(-15,15)/15,MRANDOM(-15,15)/15,MRANDOM(-15,15)/15)
  424. end
  425. body[part]:remove()
  426. end))
  427. elseif EFFECT == "Shatter" then
  428. for _, c in pairs(v:GetChildren()) do
  429. if c.ClassName == "Part" or c.ClassName == "MeshPart" then
  430. Shatter(c)
  431. end
  432. end
  433. end
  434. end
  435. end
  436. end
  437. end
  438. end
  439. end
  440. end
  441. end
  442.  
  443. ----
  444. --WACKYEFFECT({EffectType = "", Size = VT(1,1,1), Size2 = VT(0,0,0), Transparency = 0, Transparency2 = 1, CFrame = CF(), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil})
  445. function WACKYEFFECT(Table)
  446. local TYPE = (Table.EffectType or "Sphere")
  447. local SIZE = (Table.Size or VT(1,1,1))
  448. local ENDSIZE = (Table.Size2 or VT(0,0,0))
  449. local TRANSPARENCY = (Table.Transparency or 0)
  450. local ENDTRANSPARENCY = (Table.Transparency2 or 1)
  451. local CFRAME = (Table.CFrame or Torso.CFrame)
  452. local MOVEDIRECTION = (Table.MoveToPos or nil)
  453. local ROTATION1 = (Table.RotationX or 0)
  454. local ROTATION2 = (Table.RotationY or 0)
  455. local ROTATION3 = (Table.RotationZ or 0)
  456. local MATERIAL = (Table.Material or "Neon")
  457. local COLOR = (Table.Color or C3(1,1,1))
  458. local TIME = (Table.Time or 45)
  459. local SOUNDID = (Table.SoundID or nil)
  460. local SOUNDPITCH = (Table.SoundPitch or nil)
  461. local SOUNDVOLUME = (Table.SoundVolume or nil)
  462. coroutine.resume(coroutine.create(function()
  463. local PLAYSSOUND = false
  464. local SOUND = nil
  465. local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true)
  466. if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then
  467. PLAYSSOUND = true
  468. SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false)
  469. end
  470. EFFECT.Color = COLOR
  471. local MSH = nil
  472. if TYPE == "Sphere" then
  473. MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0))
  474. elseif TYPE == "Block" then
  475. MSH = IT("BlockMesh",EFFECT)
  476. MSH.Scale = VT(SIZE.X,SIZE.X,SIZE.X)
  477. elseif TYPE == "Box" then
  478. MSH = IT("BlockMesh",EFFECT)
  479. MSH.Scale = SIZE
  480. elseif TYPE == "Wave" then
  481. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
  482. elseif TYPE == "Ring" then
  483. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0))
  484. elseif TYPE == "Slash" then
  485. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
  486. elseif TYPE == "Round Slash" then
  487. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
  488. elseif TYPE == "Swirl" then
  489. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0))
  490. elseif TYPE == "Skull" then
  491. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0))
  492. elseif TYPE == "Crystal" then
  493. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0))
  494. end
  495. if MSH ~= nil then
  496. local MOVESPEED = nil
  497. if MOVEDIRECTION ~= nil then
  498. MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME
  499. end
  500. local GROWTH = SIZE - ENDSIZE
  501. local TRANS = TRANSPARENCY - ENDTRANSPARENCY
  502. if TYPE == "Block" then
  503. EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
  504. else
  505. EFFECT.CFrame = CFRAME
  506. end
  507. for LOOP = 1, TIME do
  508. Swait()
  509. MSH.Scale = MSH.Scale - GROWTH/TIME
  510. if TYPE == "Wave" then
  511. MSH.Offset = VT(0,0,-MSH.Scale.X/8)
  512. end
  513. EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME
  514. if TYPE == "Block" then
  515. EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
  516. else
  517. EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3))
  518. end
  519. if MOVEDIRECTION ~= nil then
  520. local ORI = EFFECT.Orientation
  521. EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED)
  522. EFFECT.Orientation = ORI
  523. end
  524. end
  525. if PLAYSSOUND == false then
  526. EFFECT:remove()
  527. else
  528. repeat Swait() until SOUND.Playing == false
  529. EFFECT:remove()
  530. end
  531. else
  532. if PLAYSSOUND == false then
  533. EFFECT:remove()
  534. else
  535. repeat Swait() until SOUND.Playing == false
  536. EFFECT:remove()
  537. end
  538. end
  539. end))
  540. end
  541. -----
  542. function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
  543. local NEWMESH = IT(MESH)
  544. if MESH == "SpecialMesh" then
  545. NEWMESH.MeshType = MESHTYPE
  546. if MESHID ~= "nil" and MESHID ~= "" then
  547. NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
  548. end
  549. if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
  550. NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
  551. end
  552. end
  553. NEWMESH.Offset = OFFSET or VT(0, 0, 0)
  554. NEWMESH.Scale = SCALE
  555. NEWMESH.Parent = PARENT
  556. return NEWMESH
  557. end
  558. --키입력수신
  559. function KeyDown(Key)
  560. if Key == "z" and ATTACK == false then
  561. CyberSmash()
  562. end
  563. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement