Advertisement
hjkook

g

Feb 24th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.44 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86. local h,t
  87. --Give the server mouse data every second frame, but only if the values changed
  88. --If player is not moving their mouse, client won't fire events
  89. local HB = game:GetService("RunService").Heartbeat
  90. while true do
  91. if h~=Mouse.Hit or t~=Mouse.Target then
  92. h,t=Mouse.Hit,Mouse.Target
  93. Event:FireServer({isMouse=true,Target=t,Hit=h})
  94. end
  95. --Wait 2 frames
  96. for i=1,2 do
  97. HB:Wait()
  98. end
  99. end]==],script)
  100.  
  101. ----Sandboxed game object that allows the usage of client-side methods and services
  102. --Real game object
  103. local RealGame = game
  104.  
  105. --Metatable for fake service
  106. local FakeService_Metatable = {
  107. __index = function(self,k)
  108. local s = rawget(self,"_RealService")
  109. if s then
  110. return typeof(s[k])=="function"
  111. and function(_,...)return s[k](s,...)end or s[k]
  112. end
  113. end,
  114. __newindex = function(self,k,v)
  115. local s = rawget(self,"_RealService")
  116. if s then s[k]=v end
  117. end
  118. }
  119. local function FakeService(t,RealService)
  120. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  121. return setmetatable(t,FakeService_Metatable)
  122. end
  123.  
  124. --Fake game object
  125. local FakeGame = {
  126. GetService = function(self,s)
  127. return rawget(self,s) or RealGame:GetService(s)
  128. end,
  129. Players = FakeService({
  130. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  131. },"Players"),
  132. UserInputService = FakeService(UIS,"UserInputService"),
  133. ContextActionService = FakeService(CAS,"ContextActionService"),
  134. RunService = FakeService({
  135. _btrs = {},
  136. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  137. BindToRenderStep = function(self,name,_,fun)
  138. self._btrs[name] = self.Heartbeat:Connect(fun)
  139. end,
  140. UnbindFromRenderStep = function(self,name)
  141. self._btrs[name]:Disconnect()
  142. end,
  143. },"RunService")
  144. }
  145. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  146. FakeGame.service = FakeGame.GetService
  147. FakeService(FakeGame,game)
  148. --Changing owner to fake player object to support owner:GetMouse()
  149. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  150. end
  151.  
  152. --<<Ghost V1 [REMAKER]>>--
  153. --|| || || //
  154. --||-----|| || //
  155. --|| || ||||
  156. --||-----|| || \\
  157. --|| || || \\
  158.  
  159. --[[SYSTEM]]--
  160. wait(1)
  161. local player = owner
  162. local cha = player.Character
  163. local Cam = workspace.CurrentCamera
  164. local Backpack = Player.Backpack
  165. local Larm = cha["Left Arm"]
  166. local Rarm = cha["Right Arm"]
  167. local Lleg = cha["Left Leg"]
  168. local Rleg = cha["Right Leg"]
  169. local Torso = cha.Torso
  170. local Head = cha.Head
  171. local hum = cha.Humanoid
  172. local RootPart = cha["HumanoidRootPart"]
  173. local RootJoint = hum.RootPart["RootJoint"]
  174. local Neck = Torso["Neck"]
  175. local RightShoulder = Torso["Right Shoulder"]
  176. local LeftShoulder = Torso["Left Shoulder"]
  177. local RightHip = Torso["Right Hip"]
  178. local LeftHip = Torso["Left Hip"]
  179. local Mouse = player:GetMouse()
  180. local SINE = 0
  181. local Animation_Speed = 3
  182. local ATTACK = false
  183. local Rooted = true
  184. local HOLD = false
  185. --FRAME
  186. local Frame_Speed = 1
  187. --Sound
  188. local sick = Instance.new("Sound",Torso)
  189. sick.SoundId = "rbxassetid://170282324"
  190. sick.Looped = true
  191. sick.Volume = 1
  192. sick:Play()
  193. --CF,VT,UD2,RAD,IT,BRICK,ANGLES,EULER,COS,ACOS,SIN,ASIN,ABS,MRANDOM,FLOOR
  194. local CF = CFrame.new
  195. local VT = Vector3.new
  196. local VT2 = Vector2.new
  197. local UD2 = UDim2.new
  198. local UD = UDim.new
  199. local C3 = Color3.new
  200. local RAD = math.rad
  201. local BRICKC = BrickColor.new
  202. local IT = Instance.new
  203. local ANGLES = CFrame.Angles
  204. local EU = CFrame.fromEulerAnglesXYZ
  205. local COS = math.cos
  206. local ACOS = math.acos
  207. local SIN = math.sin
  208. local asin = math.asin
  209. local abs = math.abs
  210. local MRANDOM = math.random
  211. local floor = math.floor
  212. local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  213. local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  214. local Effects = IT("Folder", cha)
  215. Effects.Name = "Effects"
  216. --ANI
  217. local ROBLOXIDLEANIMATION = IT("Animation")
  218. ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
  219. ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  220. --GHOST MAIN SYSTEM
  221. wait(1) -- WAIT COMMAND
  222. print("HK'S GHOST ACTIVE!")
  223. Larm.Transparency = 0.35
  224. Rarm.Transparency = 0.35
  225. Lleg.Transparency = 0.35
  226. Rleg.Transparency = 0.35
  227. Head.Transparency = 0.35
  228. Torso.Transparency = 0.35
  229. --BodyColors
  230. cha["Body Colors"].HeadColor = BrickColor.new("Institutional white")
  231. cha["Body Colors"].TorsoColor = BrickColor.new("Institutional white")
  232. cha["Body Colors"].LeftArmColor = BrickColor.new("Institutional white")
  233. cha["Body Colors"].RightArmColor = BrickColor.new("Institutional white")
  234. cha["Body Colors"].RightLegColor = BrickColor.new("Institutional white")
  235. cha["Body Colors"].LeftLegColor = BrickColor.new("Institutional white")
  236. --HumanoidName
  237. hum.Name = "HK.ghostMode"
  238. --Hacker
  239. Mouse.KeyDown:connect(function(key)
  240. if key == "k" then
  241. print("KillerMode")
  242. Hacker()
  243. end
  244. if key == "L" then
  245. CyberSmash()
  246. end
  247. end)
  248.  
  249.  
  250. --Hacker
  251. function Hacker()
  252. Torso.Touched:connect(function(hit)
  253. if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
  254. hit.Parent.Humanoid.Health = 0
  255. end
  256.  
  257. end)
  258.  
  259. function CyberSmash()
  260. ATTACK = true
  261. Rooted = false
  262. local GYRO = IT("BodyGyro",RootPart)
  263. GYRO.D = 100
  264. GYRO.P = 2000
  265. GYRO.MaxTorque = VT(0,4000000,0)
  266. GYRO.cframe = CF(RootPart.Position,Mouse.Hit.p)
  267. local SMASH = CreatePart(3, Effects, "Neon", 0, 1, "Really red", "Block", VT(25,25,25))
  268. SMASH.CanCollide = true
  269. SMASH.Color = C3(0,0,0)
  270. local EF = Instance.new("SelectionBox",SMASH)
  271. EF.Adornee = SMASH
  272. EF.Color = BrickColor.new("Really red")
  273. EF.LineThickness = 0.2
  274. EF.Transparency = 1
  275. coroutine.resume(coroutine.create(function()
  276. for i = 1, 20 do
  277. Swait()
  278. SMASH.Transparency = SMASH.Transparency - 0.05
  279. EF.Transparency = SMASH.Transparency
  280. end
  281. end))
  282. end
  283.  
  284. --//=================================\\
  285. --|| DAMAGING
  286. --\\=================================//
  287.  
  288. function killnearest(position,range,EFFECT)
  289. for i,v in ipairs(workspace:GetChildren()) do
  290. local body = v:GetChildren()
  291. for part = 1, #body do
  292. if((body[part].ClassName == "Part" or body[part].ClassName == "MeshPart") and v ~= cha) then
  293. local SIZE = body[part].Size.Magnitude
  294. if(body[part].Position - position).Magnitude < range + SIZE/2 then
  295. if v.ClassName == "Model" then
  296. if v:FindFirstChildOfClass("Humanoid") ~= nil then
  297. if v:FindFirstChildOfClass("Humanoid").Health > 0 then
  298. v:BreakJoints()
  299. if EFFECT == "Glitch" then
  300. coroutine.resume(coroutine.create(function()
  301. local ORIGINPOS = body[part].CFrame
  302. local SIZE = body[part].Size
  303. for i = 1, 100 do
  304. Swait()
  305. local PART = body[part]
  306. PART.Anchored = true
  307. PART.Size = SIZE*MRANDOM(5,15)/10
  308. PART.CFrame = ORIGINPOS*CF(MRANDOM(-15,15)/15,MRANDOM(-15,15)/15,MRANDOM(-15,15)/15)
  309. end
  310. body[part]:remove()
  311. end))
  312. elseif EFFECT == "Shatter" then
  313. for _, c in pairs(v:GetChildren()) do
  314. if c.ClassName == "Part" or c.ClassName == "MeshPart" then
  315. Shatter(c)
  316. end
  317. end
  318. end
  319. end
  320. end
  321. end
  322. end
  323. end
  324. end
  325. end
  326. end
  327. --if
  328. function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  329. local NEWPART = IT("Part")
  330. NEWPART.formFactor = FORMFACTOR
  331. NEWPART.Reflectance = REFLECTANCE
  332. NEWPART.Transparency = TRANSPARENCY
  333. NEWPART.CanCollide = false
  334. NEWPART.Locked = true
  335. NEWPART.Anchored = true
  336. if ANCHOR == false then
  337. NEWPART.Anchored = false
  338. end
  339. NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
  340. NEWPART.Name = NAME
  341. NEWPART.Size = SIZE
  342. NEWPART.Position = Torso.Position
  343. NEWPART.Material = MATERIAL
  344. NEWPART:BreakJoints()
  345. NEWPART.Parent = PARENT
  346. return NEWPART
  347. end
  348.  
  349. local function weldBetween(a, b)
  350. local weldd = Instance.new("ManualWeld")
  351. weldd.Part0 = a
  352. weldd.Part1 = b
  353. weldd.C0 = CFrame.new()
  354. weldd.C1 = b.CFrame:inverse() * a.CFrame
  355. weldd.Parent = a
  356. return weldd
  357. end
  358. end
  359. --FUNCTION 2
  360. function Clerp(a, b, t)
  361. local qa = {QuaternionFromCFrame(a)}
  362. local qb = {QuaternionFromCFrame(b)}
  363. local ax, ay, az = a.x, a.y, a.z
  364. local bx, by, bz = b.x, b.y, b.z
  365. local _t = 1 - t
  366. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  367. end
  368. --SUTFF
  369. function QuaternionFromCFrame(cf)
  370. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  371. local trace = m00 + m11 + m22
  372. if trace > 0 then
  373. local s = math.sqrt(1 + trace)
  374. local recip = 0.5 / s
  375. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  376. else
  377. local i = 0
  378. if m11 > m00 then
  379. i = 1
  380. end
  381. if m22 > (i == 0 and m00 or m11) then
  382. i = 2
  383. end
  384. if i == 0 then
  385. local s = math.sqrt(m00 - m11 - m22 + 1)
  386. local recip = 0.5 / s
  387. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  388. elseif i == 1 then
  389. local s = math.sqrt(m11 - m22 - m00 + 1)
  390. local recip = 0.5 / s
  391. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  392. elseif i == 2 then
  393. local s = math.sqrt(m22 - m00 - m11 + 1)
  394. local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  395. end
  396. end
  397. end
  398.  
  399. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  400. local xs, ys, zs = x + x, y + y, z + z
  401. local wx, wy, wz = w * xs, w * ys, w * zs
  402. local xx = x * xs
  403. local xy = x * ys
  404. local xz = x * zs
  405. local yy = y * ys
  406. local yz = y * zs
  407. local zz = z * zs
  408. 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))
  409. end
  410.  
  411. function QuaternionSlerp(a, b, t)
  412. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  413. local startInterp, finishInterp;
  414. if cosTheta >= 0.0001 then
  415. if (1 - cosTheta) > 0.0001 then
  416. local theta = ACOS(cosTheta)
  417. local invSinTheta = 1 / SIN(theta)
  418. startInterp = SIN((1 - t) * theta) * invSinTheta
  419. finishInterp = SIN(t * theta) * invSinTheta
  420. else
  421. startInterp = 1 - t
  422. finishInterp = t
  423. end
  424. else
  425. if (1 + cosTheta) > 0.0001 then
  426. local theta = ACOS(-cosTheta)
  427. local invSinTheta = 1 / SIN(theta)
  428. startInterp = SIN((t - 1) * theta) * invSinTheta
  429. finishInterp = SIN(t * theta) * invSinTheta
  430. else
  431. startInterp = t - 1
  432. finishInterp = t
  433. end
  434. end
  435. 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
  436. end
  437. --SWAIT
  438. function Swait(NUMBER)
  439. if NUMBER == 0 or NUMBER == nil then
  440. ArtificialHB.Event:wait()
  441. else
  442. for i = 1, NUMBER do
  443. ArtificialHB.Event:wait()
  444. end
  445. end
  446. end
  447. --NO
  448. ArtificialHB = Instance.new("BindableEvent", script)
  449. ArtificialHB.Name = "ArtificialHB"
  450.  
  451. script:WaitForChild("ArtificialHB")
  452.  
  453. frame = Frame_Speed
  454. tf = 0
  455. allowframeloss = false
  456. tossremainder = false
  457. lastframe = tick()
  458. script.ArtificialHB:Fire()
  459.  
  460. game:GetService("RunService").Heartbeat:connect(function(s, p)
  461. tf = tf + s
  462. if tf >= frame then
  463. if allowframeloss then
  464. script.ArtificialHB:Fire()
  465. lastframe = tick()
  466. else
  467. for i = 1, math.floor(tf / frame) do
  468. script.ArtificialHB:Fire()
  469. end
  470. lastframe = tick()
  471. end
  472. if tossremainder then
  473. tf = 0
  474. else
  475. tf = tf - frame * math.floor(tf / frame)
  476. end
  477. end
  478. end)
  479. --f
  480. --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})
  481. function WACKYEFFECT(Table)
  482. local TYPE = (Table.EffectType or "Sphere")
  483. local SIZE = (Table.Size or VT(1,1,1))
  484. local ENDSIZE = (Table.Size2 or VT(0,0,0))
  485. local TRANSPARENCY = (Table.Transparency or 0)
  486. local ENDTRANSPARENCY = (Table.Transparency2 or 1)
  487. local CFRAME = (Table.CFrame or Torso.CFrame)
  488. local MOVEDIRECTION = (Table.MoveToPos or nil)
  489. local ROTATION1 = (Table.RotationX or 0)
  490. local ROTATION2 = (Table.RotationY or 0)
  491. local ROTATION3 = (Table.RotationZ or 0)
  492. local MATERIAL = (Table.Material or "Neon")
  493. local COLOR = (Table.Color or C3(1,1,1))
  494. local TIME = (Table.Time or 45)
  495. local SOUNDID = (Table.SoundID or nil)
  496. local SOUNDPITCH = (Table.SoundPitch or nil)
  497. local SOUNDVOLUME = (Table.SoundVolume or nil)
  498. coroutine.resume(coroutine.create(function()
  499. local PLAYSSOUND = false
  500. local SOUND = nil
  501. local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true)
  502. if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then
  503. PLAYSSOUND = true
  504. SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false)
  505. end
  506. EFFECT.Color = COLOR
  507. local MSH = nil
  508. if TYPE == "Sphere" then
  509. MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0))
  510. elseif TYPE == "Block" then
  511. MSH = IT("BlockMesh",EFFECT)
  512. MSH.Scale = VT(SIZE.X,SIZE.X,SIZE.X)
  513. elseif TYPE == "Box" then
  514. MSH = IT("BlockMesh",EFFECT)
  515. MSH.Scale = SIZE
  516. elseif TYPE == "Wave" then
  517. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
  518. elseif TYPE == "Ring" then
  519. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0))
  520. elseif TYPE == "Slash" then
  521. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
  522. elseif TYPE == "Round Slash" then
  523. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
  524. elseif TYPE == "Swirl" then
  525. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0))
  526. elseif TYPE == "Skull" then
  527. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0))
  528. elseif TYPE == "Crystal" then
  529. MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0))
  530. end
  531. if MSH ~= nil then
  532. local MOVESPEED = nil
  533. if MOVEDIRECTION ~= nil then
  534. MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME
  535. end
  536. local GROWTH = SIZE - ENDSIZE
  537. local TRANS = TRANSPARENCY - ENDTRANSPARENCY
  538. if TYPE == "Block" then
  539. EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
  540. else
  541. EFFECT.CFrame = CFRAME
  542. end
  543. for LOOP = 1, TIME do
  544. Swait()
  545. MSH.Scale = MSH.Scale - GROWTH/TIME
  546. if TYPE == "Wave" then
  547. MSH.Offset = VT(0,0,-MSH.Scale.X/8)
  548. end
  549. EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME
  550. if TYPE == "Block" then
  551. EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
  552. else
  553. EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3))
  554. end
  555. if MOVEDIRECTION ~= nil then
  556. local ORI = EFFECT.Orientation
  557. EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED)
  558. EFFECT.Orientation = ORI
  559. end
  560. end
  561. if PLAYSSOUND == false then
  562. EFFECT:remove()
  563. else
  564. repeat Swait() until SOUND.Playing == false
  565. EFFECT:remove()
  566. end
  567. else
  568. if PLAYSSOUND == false then
  569. EFFECT:remove()
  570. else
  571. repeat Swait() until SOUND.Playing == false
  572. EFFECT:remove()
  573. end
  574. end
  575. end))
  576. end
  577. --v
  578. local S = IT("Sound")
  579. function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
  580. local NEWSOUND = nil
  581. coroutine.resume(coroutine.create(function()
  582. NEWSOUND = S:Clone()
  583. NEWSOUND.Parent = PARENT
  584. NEWSOUND.Volume = VOLUME
  585. NEWSOUND.Pitch = PITCH
  586. NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
  587. NEWSOUND:play()
  588. NEWSOUND.Name = "Audio"
  589. if DOESLOOP == true then
  590. NEWSOUND.Looped = true
  591. else
  592. repeat Swait() until NEWSOUND.Playing == false
  593. NEWSOUND:remove()
  594. end
  595. end))
  596. return NEWSOUND
  597. end
  598. --d
  599. function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
  600. local NEWMESH = IT(MESH)
  601. if MESH == "SpecialMesh" then
  602. NEWMESH.MeshType = MESHTYPE
  603. if MESHID ~= "nil" and MESHID ~= "" then
  604. NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
  605. end
  606. if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
  607. NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
  608. end
  609. end
  610. NEWMESH.Offset = OFFSET or VT(0, 0, 0)
  611. NEWMESH.Scale = SCALE
  612. NEWMESH.Parent = PARENT
  613. return NEWMESH
  614. end
  615. --
  616. function Shatter(Part)
  617. if Part.Transparency == 0 then
  618. local SOUNDPART = CreatePart(3, Effects, "Neon", 0, 1, Part.BrickColor, "OOF", VT(0,0,0))
  619. Debris:AddItem(SOUNDPART,5)
  620. CreateSound("84005018", SOUNDPART, 3, MRANDOM(8,12)/10, false)
  621. local SIZE = Part.Size.X + Part.Size.Y + Part.Size.Z
  622. local SIZESET = SIZE/4
  623. local XOffset = Part.Size.X*1.5/SIZESET
  624. local YOffset = Part.Size.Y*1.5/SIZESET
  625. local ZOffset = Part.Size.Z*1.5/SIZESET
  626. for x = 1, math.ceil(XOffset) do
  627. for y = 1, math.ceil(YOffset) do
  628. for z = 1, math.ceil(ZOffset) do
  629. local SHARD = CreatePart(3, Effects, "Neon", 0, 0, Part.BrickColor, "Shard", VT(SIZE,SIZE,SIZE)/10, false)
  630. SHARD.CanCollide = true
  631. SHARD.CFrame = Part.CFrame*CF((Part.Size.X/2-x/4),(Part.Size.Y/2-y/4),(Part.Size.Z/2-z/4))
  632. SHARD.Velocity = VT(MRANDOM(-15,15),MRANDOM(-15,15),MRANDOM(-15,15))*3
  633. Debris:AddItem(SHARD,MRANDOM(10,25)/3)
  634. end
  635. end
  636. end
  637. end
  638. Part:remove()
  639. end
  640. --
  641. function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
  642. return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
  643. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement