Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.87 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.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. ----------------------------------------------------------------
  153. --//Hat Kid!\\--
  154. ----------------------------------------------------------------
  155.  
  156. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  157. local Player,game,owner = owner,game
  158. local RealPlayer = Player
  159. do
  160. local rp = RealPlayer
  161. script.Parent = rp.Character
  162.  
  163. --RemoteEvent for communicating
  164. local Event = Instance.new("RemoteEvent")
  165. Event.Name = "UserInput_Event"
  166.  
  167. --Fake event to make stuff like Mouse.KeyDown work
  168. local function fakeEvent()
  169. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  170. t.connect = t.Connect
  171. return t
  172. end
  173.  
  174. --Creating fake input objects with fake variables
  175. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  176. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  177. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  178. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  179. end}
  180. --Merged 2 functions into one by checking amount of arguments
  181. CAS.UnbindAction = CAS.BindAction
  182.  
  183. --This function will trigger the events that have been :Connect()'ed
  184. local function te(self,ev,...)
  185. local t = m[ev]
  186. if t and t._fakeEvent then
  187. for _,f in pairs(t.Functions) do
  188. f(...)
  189. end
  190. end
  191. end
  192. m.TrigEvent = te
  193. UIS.TrigEvent = te
  194.  
  195. Event.OnServerEvent:Connect(function(plr,io)
  196. if plr~=rp then return end
  197. m.Target = io.Target
  198. m.Hit = io.Hit
  199. if not io.isMouse then
  200. local b = io.UserInputState == Enum.UserInputState.Begin
  201. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  202. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  203. end
  204. for _,t in pairs(CAS.Actions) do
  205. for _,k in pairs(t.Keys) do
  206. if k==io.KeyCode then
  207. t.Function(t.Name,io.UserInputState,io)
  208. end
  209. end
  210. end
  211. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  212. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  213. end
  214. end)
  215. Event.Parent = NLS([==[
  216. local Player = game:GetService("Players").LocalPlayer
  217. local Event = script:WaitForChild("UserInput_Event")
  218.  
  219. local Mouse = Player:GetMouse()
  220. local UIS = game:GetService("UserInputService")
  221. local input = function(io,a)
  222. if a then return end
  223. --Since InputObject is a client-side instance, we create and pass table instead
  224. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  225. end
  226. UIS.InputBegan:Connect(input)
  227. UIS.InputEnded:Connect(input)
  228.  
  229. local h,t
  230. --Give the server mouse data 30 times every second, but only if the values changed
  231. --If player is not moving their mouse, client won't fire events
  232. while wait(1/30) do
  233. if h~=Mouse.Hit or t~=Mouse.Target then
  234. h,t=Mouse.Hit,Mouse.Target
  235. Event:FireServer({isMouse=true,Target=t,Hit=h})
  236. end
  237. end]==],Player.Character)
  238.  
  239. ----Sandboxed game object that allows the usage of client-side methods and services
  240. --Real game object
  241. local _rg = game
  242.  
  243. --Metatable for fake service
  244. local fsmt = {
  245. __index = function(self,k)
  246. local s = rawget(self,"_RealService")
  247. if s then return s[k] end
  248. end,
  249. __newindex = function(self,k,v)
  250. local s = rawget(self,"_RealService")
  251. if s then s[k]=v end
  252. end,
  253. __call = function(self,...)
  254. local s = rawget(self,"_RealService")
  255. if s then return s(...) end
  256. end
  257. }
  258. local function FakeService(t,RealService)
  259. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  260. return setmetatable(t,fsmt)
  261. end
  262.  
  263. --Fake game object
  264. local g = {
  265. GetService = function(self,s)
  266. return self[s]
  267. end,
  268. Players = FakeService({
  269. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  270. },"Players"),
  271. UserInputService = FakeService(UIS,"UserInputService"),
  272. ContextActionService = FakeService(CAS,"ContextActionService"),
  273. }
  274. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  275. g.service = g.GetService
  276.  
  277. g.RunService = FakeService({
  278. RenderStepped = _rg:GetService("RunService").Heartbeat,
  279. BindToRenderStep = function(self,name,_,fun)
  280. self._btrs[name] = self.Heartbeat:Connect(fun)
  281. end,
  282. UnbindFromRenderStep = function(self,name)
  283. self._btrs[name]:Disconnect()
  284. end,
  285. },"RunService")
  286.  
  287. setmetatable(g,{
  288. __index=function(self,s)
  289. return _rg:GetService(s) or typeof(_rg[s])=="function"
  290. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  291. end,
  292. __newindex = fsmt.__newindex,
  293. __call = fsmt.__call
  294. })
  295. --Changing owner to fake player object to support owner:GetMouse()
  296. game,owner = g,g.Players.LocalPlayer
  297. end
  298.  
  299. Player = owner
  300. PlayerGui = Player.PlayerGui
  301. Cam = workspace.CurrentCamera
  302. Backpack = Player.Backpack
  303. Character = Player.Character
  304. Humanoid = Character.Humanoid
  305. Mouse = Player:GetMouse()
  306. RootPart = Character["HumanoidRootPart"]
  307. Torso = Character["Torso"]
  308. Head = Character["Head"]
  309. RightArm = Character["Right Arm"]
  310. LeftArm = Character["Left Arm"]
  311. RightLeg = Character["Right Leg"]
  312. LeftLeg = Character["Left Leg"]
  313. RootJoint = RootPart["RootJoint"]
  314. Neck = Torso["Neck"]
  315. RightShoulder = Torso["Right Shoulder"]
  316. LeftShoulder = Torso["Left Shoulder"]
  317. RightHip = Torso["Right Hip"]
  318. LeftHip = Torso["Left Hip"]
  319.  
  320. removeuseless = game:GetService("Debris")
  321. laff = Instance.new("Sound",Head)
  322. tauntdebounce = false
  323. Character = Player.Character
  324. Humanoid = Character.Humanoid
  325. ---------
  326. plr = game.Players.LocalPlayer
  327. chara = plr.Character
  328. mouse = plr:GetMouse()
  329. Create = Instance.new
  330. Huge = math.huge
  331.  
  332. Player = game:GetService("Players").LocalPlayer
  333. PlayerGui = Player.PlayerGui
  334. Cam = workspace.CurrentCamera
  335. Backpack = Player.Backpack
  336. Character = Player.Character
  337. char = Player.Character
  338. Humanoid = Character.Humanoid
  339. Mouse = Player:GetMouse()
  340. RootPart = Character["HumanoidRootPart"]
  341. Torso = Character["Torso"]
  342. Head = Character["Head"]
  343. RightArm = Character["Right Arm"]
  344. LeftArm = Character["Left Arm"]
  345. RightLeg = Character["Right Leg"]
  346. LeftLeg = Character["Left Leg"]
  347. RootJoint = RootPart["RootJoint"]
  348. Neck = Torso["Neck"]
  349. RightShoulder = Torso["Right Shoulder"]
  350. LeftShoulder = Torso["Left Shoulder"]
  351. RightHip = Torso["Right Hip"]
  352. LeftHip = Torso["Left Hip"]
  353.  
  354. local Orin = "http://www.roblox.com/asset/?id=1065951398"
  355. Head.face.Texture = Orin
  356. function weld(a, b, acf)
  357. local w = Instance.new("Weld", a)
  358. w.Part0 = a
  359. w.Part1 = b
  360. w.C0 = acf
  361. end
  362. --------------------------------
  363. char.Head.face.Texture = "rbxassetid://1065951398"
  364. --------------------------------
  365.  
  366. -------------------------------------------------------
  367. wait(0.2)
  368. local plr = game:service'Players'.LocalPlayer
  369. local char = plr.Character
  370. local hum = char.Humanoid
  371. local hed = char.Head
  372. local root = char.HumanoidRootPart
  373. local rootj = root.RootJoint
  374. local tors = char.Torso
  375. local ra = char["Right Arm"]
  376. local la = char["Left Arm"]
  377. local rl = char["Right Leg"]
  378. local ll = char["Left Leg"]
  379. local neck = tors["Neck"]
  380. local mouse = plr:GetMouse()
  381. local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  382. local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
  383. local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
  384. local maincolor = BrickColor.new("Plum")
  385.  
  386. -------------------------------------------------------
  387. --Start Good Stuff--
  388. -------------------------------------------------------
  389. cam = game.Workspace.CurrentCamera
  390. CF = CFrame.new
  391. angles = CFrame.Angles
  392. attack = false
  393. Euler = CFrame.fromEulerAnglesXYZ
  394. Rad = math.rad
  395. IT = Instance.new
  396. BrickC = BrickColor.new
  397. Cos = math.cos
  398. Acos = math.acos
  399. Sin = math.sin
  400. Asin = math.asin
  401. Abs = math.abs
  402. Mrandom = math.random
  403. Floor = math.floor
  404. -------------------------------------------------------
  405. --End Good Stuff--
  406. -------------------------------------------------------
  407. -------------------------------------------------------
  408. --Start HeartBeat--
  409. -------------------------------------------------------
  410. ArtificialHB = Instance.new("BindableEvent", script)
  411. ArtificialHB.Name = "Heartbeat"
  412. script:WaitForChild("Heartbeat")
  413.  
  414. frame = 1 / 60
  415. tf = 0
  416. allowframeloss = false
  417. tossremainder = false
  418.  
  419.  
  420. lastframe = tick()
  421. script.Heartbeat:Fire()
  422.  
  423.  
  424. game:GetService("RunService").Heartbeat:connect(function(s, p)
  425. tf = tf + s
  426. if tf >= frame then
  427. if allowframeloss then
  428. script.Heartbeat:Fire()
  429. lastframe = tick()
  430. else
  431. for i = 1, math.floor(tf / frame) do
  432. script.Heartbeat:Fire()
  433. end
  434. lastframe = tick()
  435. end
  436. if tossremainder then
  437. tf = 0
  438. else
  439. tf = tf - frame * math.floor(tf / frame)
  440. end
  441. end
  442. end)
  443. -------------------------------------------------------
  444. --End HeartBeat--
  445. -------------------------------------------------------
  446.  
  447. -------------------------------------------------------
  448. --Start Important Functions--
  449. -------------------------------------------------------
  450. function swait(num)
  451. if num == 0 or num == nil then
  452. game:service("RunService").Stepped:wait(0)
  453. else
  454. for i = 0, num do
  455. game:service("RunService").Stepped:wait(0)
  456. end
  457. end
  458. end
  459. function thread(f)
  460. coroutine.resume(coroutine.create(f))
  461. end
  462. function clerp(a, b, t)
  463. local qa = {
  464. QuaternionFromCFrame(a)
  465. }
  466. local qb = {
  467. QuaternionFromCFrame(b)
  468. }
  469. local ax, ay, az = a.x, a.y, a.z
  470. local bx, by, bz = b.x, b.y, b.z
  471. local _t = 1 - t
  472. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  473. end
  474. function QuaternionFromCFrame(cf)
  475. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  476. local trace = m00 + m11 + m22
  477. if trace > 0 then
  478. local s = math.sqrt(1 + trace)
  479. local recip = 0.5 / s
  480. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  481. else
  482. local i = 0
  483. if m00 < m11 then
  484. i = 1
  485. end
  486. if m22 > (i == 0 and m00 or m11) then
  487. i = 2
  488. end
  489. if i == 0 then
  490. local s = math.sqrt(m00 - m11 - m22 + 1)
  491. local recip = 0.5 / s
  492. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  493. elseif i == 1 then
  494. local s = math.sqrt(m11 - m22 - m00 + 1)
  495. local recip = 0.5 / s
  496. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  497. elseif i == 2 then
  498. local s = math.sqrt(m22 - m00 - m11 + 1)
  499. local recip = 0.5 / s
  500. return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  501. end
  502. end
  503. end
  504. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  505. local xs, ys, zs = x + x, y + y, z + z
  506. local wx, wy, wz = w * xs, w * ys, w * zs
  507. local xx = x * xs
  508. local xy = x * ys
  509. local xz = x * zs
  510. local yy = y * ys
  511. local yz = y * zs
  512. local zz = z * zs
  513. 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))
  514. end
  515. function QuaternionSlerp(a, b, t)
  516. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  517. local startInterp, finishInterp
  518. if cosTheta >= 1.0E-4 then
  519. if 1 - cosTheta > 1.0E-4 then
  520. local theta = math.acos(cosTheta)
  521. local invSinTheta = 1 / Sin(theta)
  522. startInterp = Sin((1 - t) * theta) * invSinTheta
  523. finishInterp = Sin(t * theta) * invSinTheta
  524. else
  525. startInterp = 1 - t
  526. finishInterp = t
  527. end
  528. elseif 1 + cosTheta > 1.0E-4 then
  529. local theta = math.acos(-cosTheta)
  530. local invSinTheta = 1 / Sin(theta)
  531. startInterp = Sin((t - 1) * theta) * invSinTheta
  532. finishInterp = Sin(t * theta) * invSinTheta
  533. else
  534. startInterp = t - 1
  535. finishInterp = t
  536. end
  537. 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
  538. end
  539. function rayCast(Position, Direction, Range, Ignore)
  540. return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  541. end
  542. local RbxUtility = LoadLibrary("RbxUtility")
  543. local Create = RbxUtility.Create
  544.  
  545. -------------------------------------------------------
  546. --Start Damage Function--
  547. -------------------------------------------------------
  548. function Damage(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch)
  549. if hit.Parent == nil then
  550. return
  551. end
  552. local h = hit.Parent:FindFirstChildOfClass("Humanoid")
  553. for _, v in pairs(hit.Parent:children()) do
  554. if v:IsA("Humanoid") then
  555. h = v
  556. end
  557. end
  558. if h ~= nil and hit.Parent.Name ~= char.Name and hit.Parent:FindFirstChild("UpperTorso") ~= nil then
  559.  
  560. hit.Parent:FindFirstChild("Head"):BreakJoints()
  561. end
  562.  
  563. if h ~= nil and hit.Parent.Name ~= char.Name and hit.Parent:FindFirstChild("Torso") ~= nil then
  564. if hit.Parent:findFirstChild("DebounceHit") ~= nil then
  565. if hit.Parent.DebounceHit.Value == true then
  566. return
  567. end
  568. end
  569. if insta == true then
  570. hit.Parent:FindFirstChild("Head"):BreakJoints()
  571. end
  572. local c = Create("ObjectValue"){
  573. Name = "creator",
  574. Value = game:service("Players").LocalPlayer,
  575. Parent = h,
  576. }
  577. game:GetService("Debris"):AddItem(c, .5)
  578. if HitSound ~= nil and HitPitch ~= nil then
  579. CFuncs.Sound.Create(HitSound, hit, 1, HitPitch)
  580. end
  581. local Damage = math.random(minim, maxim)
  582. local blocked = false
  583. local block = hit.Parent:findFirstChild("Block")
  584. if block ~= nil then
  585. if block.className == "IntValue" then
  586. if block.Value > 0 then
  587. blocked = true
  588. block.Value = block.Value - 1
  589. print(block.Value)
  590. end
  591. end
  592. end
  593. if blocked == false then
  594. h.Health = h.Health - Damage
  595. ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, tors.BrickColor.Color)
  596. else
  597. h.Health = h.Health - (Damage / 2)
  598. ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, tors.BrickColor.Color)
  599. end
  600. if Type == "Knockdown" then
  601. local hum = hit.Parent.Humanoid
  602. hum.PlatformStand = true
  603. coroutine.resume(coroutine.create(function(HHumanoid)
  604. swait(1)
  605. HHumanoid.PlatformStand = false
  606. end), hum)
  607. local angle = (hit.Position - (Property.Position + Vector3.new(0, 0, 0))).unit
  608. local bodvol = Create("BodyVelocity"){
  609. velocity = angle * knockback,
  610. P = 5000,
  611. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  612. Parent = hit,
  613. }
  614. local rl = Create("BodyAngularVelocity"){
  615. P = 3000,
  616. maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
  617. angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
  618. Parent = hit,
  619. }
  620. game:GetService("Debris"):AddItem(bodvol, .5)
  621. game:GetService("Debris"):AddItem(rl, .5)
  622. elseif Type == "Normal" then
  623. local vp = Create("BodyVelocity"){
  624. P = 500,
  625. maxForce = Vector3.new(math.huge, 0, math.huge),
  626. velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05,
  627. }
  628. if knockback > 0 then
  629. vp.Parent = hit.Parent.Torso
  630. end
  631. game:GetService("Debris"):AddItem(vp, .5)
  632. elseif Type == "Up" then
  633. local bodyVelocity = Create("BodyVelocity"){
  634. velocity = Vector3.new(0, 20, 0),
  635. P = 5000,
  636. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  637. Parent = hit,
  638. }
  639. game:GetService("Debris"):AddItem(bodyVelocity, .5)
  640. elseif Type == "DarkUp" then
  641. coroutine.resume(coroutine.create(function()
  642. for i = 0, 1, 0.1 do
  643. swait()
  644. Effects.Block.Create(BrickColor.new("Really red"), hit.Parent.Torso.CFrame, 5, 5, 5, 1, 1, 1, .08, 1)
  645. end
  646. end))
  647. local bodyVelocity = Create("BodyVelocity"){
  648. velocity = Vector3.new(0, 20, 0),
  649. P = 5000,
  650. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  651. Parent = hit,
  652. }
  653. game:GetService("Debris"):AddItem(bodyVelocity, 1)
  654. elseif Type == "Snare" then
  655. local bp = Create("BodyPosition"){
  656. P = 2000,
  657. D = 100,
  658. maxForce = Vector3.new(math.huge, math.huge, math.huge),
  659. position = hit.Parent.Torso.Position,
  660. Parent = hit.Parent.Torso,
  661. }
  662. game:GetService("Debris"):AddItem(bp, 1)
  663. elseif Type == "Freeze" then
  664. local BodPos = Create("BodyPosition"){
  665. P = 50000,
  666. D = 1000,
  667. maxForce = Vector3.new(math.huge, math.huge, math.huge),
  668. position = hit.Parent.Torso.Position,
  669. Parent = hit.Parent.Torso,
  670. }
  671. local BodGy = Create("BodyGyro") {
  672. maxTorque = Vector3.new(4e+005, 4e+005, 4e+005) * math.huge ,
  673. P = 20e+003,
  674. Parent = hit.Parent.Torso,
  675. cframe = hit.Parent.Torso.CFrame,
  676. }
  677. hit.Parent.Torso.Anchored = true
  678. coroutine.resume(coroutine.create(function(Part)
  679. swait(1.5)
  680. Part.Anchored = false
  681. end), hit.Parent.Torso)
  682. game:GetService("Debris"):AddItem(BodPos, 3)
  683. game:GetService("Debris"):AddItem(BodGy, 3)
  684. end
  685. local debounce = Create("BoolValue"){
  686. Name = "DebounceHit",
  687. Parent = hit.Parent,
  688. Value = true,
  689. }
  690. game:GetService("Debris"):AddItem(debounce, Delay)
  691. c = Create("ObjectValue"){
  692. Name = "creator",
  693. Value = Player,
  694. Parent = h,
  695. }
  696. game:GetService("Debris"):AddItem(c, .5)
  697. end
  698. end
  699. -------------------------------------------------------
  700. --End Damage Function--
  701. -------------------------------------------------------
  702.  
  703. -------------------------------------------------------
  704. --Start Damage Function Customization--
  705. -------------------------------------------------------
  706. function ShowDamage(Pos, Text, Time, Color)
  707. local Rate = (1 / 30)
  708. local Pos = (Pos or Vector3.new(0, 0, 0))
  709. local Text = (Text or "")
  710. local Time = (Time or 2)
  711. local Color = (Color or Color3.new(255, 255, 1))
  712. local EffectPart = CFuncs.Part.Create(workspace, "SmoothPlastic", 0, 1, BrickColor.new(Color), "Effect", Vector3.new(0, 0, 0))
  713. EffectPart.Anchored = true
  714. local BillboardGui = Create("BillboardGui"){
  715. Size = UDim2.new(3, 0, 3, 0),
  716. Adornee = EffectPart,
  717. Parent = EffectPart,
  718. }
  719. local TextLabel = Create("TextLabel"){
  720. BackgroundTransparency = 1,
  721. Size = UDim2.new(1, 0, 1, 0),
  722. Text = Text,
  723. Font = "Bodoni",
  724. TextColor3 = Color,
  725. TextScaled = true,
  726. TextStrokeColor3 = Color3.fromRGB(0,0,0),
  727. Parent = BillboardGui,
  728. }
  729. game.Debris:AddItem(EffectPart, (Time))
  730. EffectPart.Parent = game:GetService("Workspace")
  731. delay(0, function()
  732. local Frames = (Time / Rate)
  733. for Frame = 1, Frames do
  734. wait(Rate)
  735. local Percent = (Frame / Frames)
  736. EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0)
  737. TextLabel.TextTransparency = Percent
  738. end
  739. if EffectPart and EffectPart.Parent then
  740. EffectPart:Destroy()
  741. end
  742. end)
  743. end
  744. -------------------------------------------------------
  745. --End Damage Function Customization--
  746. -------------------------------------------------------
  747.  
  748. function MagniDamage(Part, magni, mindam, maxdam, knock, Type)
  749. for _, c in pairs(workspace:children()) do
  750. local hum = c:findFirstChild("Humanoid")
  751. if hum ~= nil then
  752. local head = c:findFirstChild("Head")
  753. if head ~= nil then
  754. local targ = head.Position - Part.Position
  755. local mag = targ.magnitude
  756. if magni >= mag and c.Name ~= plr.Name then
  757. Damage(head, head, mindam, maxdam, knock, Type, root, 0.1, "http://www.roblox.com/asset/?id=0", 1.2)
  758. end
  759. end
  760. end
  761. end
  762. end
  763.  
  764.  
  765. CFuncs = {
  766. Part = {
  767. Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  768. local Part = Create("Part")({
  769. Parent = Parent,
  770. Reflectance = Reflectance,
  771. Transparency = Transparency,
  772. CanCollide = false,
  773. Locked = true,
  774. BrickColor = BrickColor.new(tostring(BColor)),
  775. Name = Name,
  776. Size = Size,
  777. Material = Material
  778. })
  779. RemoveOutlines(Part)
  780. return Part
  781. end
  782. },
  783. Mesh = {
  784. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  785. local Msh = Create(Mesh)({
  786. Parent = Part,
  787. Offset = OffSet,
  788. Scale = Scale
  789. })
  790. if Mesh == "SpecialMesh" then
  791. Msh.MeshType = MeshType
  792. Msh.MeshId = MeshId
  793. end
  794. return Msh
  795. end
  796. },
  797. Mesh = {
  798. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  799. local Msh = Create(Mesh)({
  800. Parent = Part,
  801. Offset = OffSet,
  802. Scale = Scale
  803. })
  804. if Mesh == "SpecialMesh" then
  805. Msh.MeshType = MeshType
  806. Msh.MeshId = MeshId
  807. end
  808. return Msh
  809. end
  810. },
  811. Weld = {
  812. Create = function(Parent, Part0, Part1, C0, C1)
  813. local Weld = Create("Weld")({
  814. Parent = Parent,
  815. Part0 = Part0,
  816. Part1 = Part1,
  817. C0 = C0,
  818. C1 = C1
  819. })
  820. return Weld
  821. end
  822. },
  823. Sound = {
  824. Create = function(id, par, vol, pit)
  825. coroutine.resume(coroutine.create(function()
  826. local S = Create("Sound")({
  827. Volume = vol,
  828. Pitch = pit or 1,
  829. SoundId = id,
  830. Parent = par or workspace
  831. })
  832. wait()
  833. S:play()
  834. game:GetService("Debris"):AddItem(S, 6)
  835. end))
  836. end
  837. },
  838. ParticleEmitter = {
  839. Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
  840. local fp = Create("ParticleEmitter")({
  841. Parent = Parent,
  842. Color = ColorSequence.new(Color1, Color2),
  843. LightEmission = LightEmission,
  844. Size = Size,
  845. Texture = Texture,
  846. Transparency = Transparency,
  847. ZOffset = ZOffset,
  848. Acceleration = Accel,
  849. Drag = Drag,
  850. LockedToPart = LockedToPart,
  851. VelocityInheritance = VelocityInheritance,
  852. EmissionDirection = EmissionDirection,
  853. Enabled = Enabled,
  854. Lifetime = LifeTime,
  855. Rate = Rate,
  856. Rotation = Rotation,
  857. RotSpeed = RotSpeed,
  858. Speed = Speed,
  859. VelocitySpread = VelocitySpread
  860. })
  861. return fp
  862. end
  863. }
  864. }
  865. function RemoveOutlines(part)
  866. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  867. end
  868. function CreatePart(FormFactor, Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  869. local Part = Create("Part")({
  870. formFactor = FormFactor,
  871. Parent = Parent,
  872. Reflectance = Reflectance,
  873. Transparency = Transparency,
  874. CanCollide = false,
  875. Locked = true,
  876. BrickColor = BrickColor.new(tostring(BColor)),
  877. Name = Name,
  878. Size = Size,
  879. Material = Material
  880. })
  881. RemoveOutlines(Part)
  882. return Part
  883. end
  884. function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  885. local Msh = Create(Mesh)({
  886. Parent = Part,
  887. Offset = OffSet,
  888. Scale = Scale
  889. })
  890. if Mesh == "SpecialMesh" then
  891. Msh.MeshType = MeshType
  892. Msh.MeshId = MeshId
  893. end
  894. return Msh
  895. end
  896. function CreateWeld(Parent, Part0, Part1, C0, C1)
  897. local Weld = Create("Weld")({
  898. Parent = Parent,
  899. Part0 = Part0,
  900. Part1 = Part1,
  901. C0 = C0,
  902. C1 = C1
  903. })
  904. return Weld
  905. end
  906.  
  907.  
  908.  
  909. -------------------------------------------------------
  910. --End Effect Function--
  911. -------------------------------------------------------
  912. function Cso(ID, PARENT, VOLUME, PITCH)
  913. local NSound = nil
  914. coroutine.resume(coroutine.create(function()
  915. NSound = IT("Sound", PARENT)
  916. NSound.Volume = VOLUME
  917. NSound.Pitch = PITCH
  918. NSound.SoundId = "http://www.roblox.com/asset/?id="..ID
  919. swait()
  920. NSound:play()
  921. game:GetService("Debris"):AddItem(NSound, 50)
  922. end))
  923. return NSound
  924. end
  925. function CameraEnshaking(Length, Intensity)
  926. coroutine.resume(coroutine.create(function()
  927. local intensity = 1 * Intensity
  928. local rotM = 0.01 * Intensity
  929. for i = 0, Length, 0.1 do
  930. swait()
  931. intensity = intensity - 0.05 * Intensity / Length
  932. rotM = rotM - 5.0E-4 * Intensity / Length
  933. hum.CameraOffset = Vector3.new(Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity)))
  934. 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)
  935. end
  936. hum.CameraOffset = Vector3.new(0, 0, 0)
  937. end))
  938. end
  939. -------------------------------------------------------
  940. --End Important Functions--
  941. -------------------------------------------------------
  942.  
  943. ----------------------------------------------------------------------------------
  944. hum.WalkSpeed = 16
  945. hum.JumpPower = 57
  946. ----------------------------------------------------------------------------------
  947. local AddInstance = function(Object, ...)
  948. local Obj = Instance.new(Object)
  949. for i,v in next,(...) do
  950. Obj[i] = v
  951. end
  952. return Obj
  953. end
  954. ----------------------------------------------------
  955.  
  956. local Reaper = AddInstance("Part",{
  957. Parent = hed,
  958. CFrame = hed.CFrame,
  959. formFactor = "Symmetric",
  960. Size = Vector3.new(1, 1, 1),
  961. CanCollide = false,
  962. TopSurface = "Smooth",
  963. BottomSurface = "Smooth",
  964. Locked = true,
  965. })
  966. local Weld = AddInstance("Weld",{
  967. Parent = Reaper,
  968. Part0 = hed,
  969. C0 = CFrame.new(0, 1.45, 0)*CFrame.Angles(0, 0, 0),
  970. Part1 = Reaper,
  971. })
  972. local Mesh = AddInstance("SpecialMesh",{
  973. Parent = Reaper,
  974. MeshId = "rbxassetid://2711178",
  975. TextureId = "rbxassetid://2938935864",
  976. Scale = Vector3.new(0.85,0.85,0.85),
  977. VertexColor = Vector3.new(1, 1, 1),
  978. })
  979.  
  980. -------------------------------------------------------
  981. local Hair = AddInstance("Part",{
  982. Parent = hed,
  983. CFrame = hed.CFrame,
  984. formFactor = "Symmetric",
  985. Size = Vector3.new(1, 1, 1),
  986. CanCollide = false,
  987. TopSurface = "Smooth",
  988. BottomSurface = "Smooth",
  989. Locked = true,
  990. })
  991. local Weld = AddInstance("Weld",{
  992. Parent = Hair,
  993. Part0 = hed,
  994. C0 = CFrame.new(-0.05, 0.35, 0.4)*CFrame.Angles(0, 0, 0),
  995. Part1 = Hair,
  996. })
  997. local Mesh = AddInstance("SpecialMesh",{
  998. Parent = Hair,
  999. MeshId = "rbxassetid://1138830322",
  1000. TextureId = "rbxassetid://869796655",
  1001. Scale = Vector3.new(0.6,0.6,0.6),
  1002. VertexColor = Vector3.new(1, 1, 1),
  1003. })
  1004. -------------------------------------------------------
  1005. local Cape = AddInstance("Part",{
  1006. Parent = Torso,
  1007. CFrame = Torso.CFrame,
  1008. formFactor = "Symmetric",
  1009. Size = Vector3.new(1, 1, 1),
  1010. CanCollide = false,
  1011. TopSurface = "Smooth",
  1012. BottomSurface = "Smooth",
  1013. Locked = true,
  1014. })
  1015. local Weld = AddInstance("Weld",{
  1016. Parent = Cape,
  1017. Part0 = Torso,
  1018. C0 = CFrame.new(0, -0.2, 0.35)*CFrame.Angles(0, 0, 0),
  1019. Part1 = Cape,
  1020. })
  1021. local Mesh = AddInstance("SpecialMesh",{
  1022. Parent = Cape,
  1023. MeshId = "rbxassetid://114046169",
  1024. TextureId = "rbxassetid://501524456",
  1025. Scale = Vector3.new(1.3,1.3,1.3),
  1026. VertexColor = Vector3.new(1, 1, 1),
  1027. })
  1028. ---------------------------------------------------------------
  1029. wait(1)
  1030. plr = game.Players.LocalPlayer
  1031. char = plr.Character
  1032. mouse = plr:GetMouse()
  1033. whitecolor = Color3.new(255,255,1)
  1034. epicmode = false
  1035. normal = true
  1036. for i,v in pairs(char:GetChildren()) do
  1037. if v.ClassName == "Shirt" or v.ClassName == "Pants" or v.ClassName == "ShirtGraphic" then
  1038. v:Destroy()
  1039. end
  1040. end
  1041. local shirt = Instance.new("Shirt",char)
  1042. shirt.ShirtTemplate = "rbxassetid://1408840214"
  1043. local pants = Instance.new("Pants",char)
  1044. pants.PantsTemplate = "rbxassetid://1409282652"
  1045. local bdycolors = char["Body Colors"]
  1046. bdycolors.HeadColor3 = whitecolor
  1047. bdycolors.LeftArmColor3 = whitecolor
  1048. bdycolors.LeftLegColor3 = whitecolor
  1049. bdycolors.RightArmColor3 = whitecolor
  1050. bdycolors.RightLegColor3 = whitecolor
  1051. bdycolors.TorsoColor3 = whitecolor
  1052. for i,v in pairs(char:GetChildren()) do
  1053. if v.ClassName == "Hat" or v.ClassName == "Accessory" then
  1054. v:Destroy()
  1055. end
  1056. end
  1057.  
  1058.  
  1059.  
  1060. local BC = Character["Body Colors"]
  1061. BC.HeadColor = BrickColor.new("Pastel brown")
  1062. BC.LeftArmColor = BrickColor.new("Pastel brown")
  1063. BC.LeftLegColor = BrickColor.new("Pastel brown")
  1064. BC.RightArmColor = BrickColor.new("Pastel brown")
  1065. BC.RightLegColor = BrickColor.new("Pastel brown")
  1066. BC.TorsoColor = BrickColor.new("Pastel brown")
  1067.  
  1068. -----------------------------------------------
  1069.  
  1070. theme = Instance.new("Sound", Head)
  1071. theme.Volume = 0.7
  1072. theme.Name = "theme"
  1073. theme.Looped = true
  1074.  
  1075. mouse.KeyDown:connect(function(Press)
  1076. Press=Press:lower()
  1077. if Press=='z' then
  1078. id = 0
  1079. theme.SoundId = "rbxassetid://"..id
  1080. theme:Play()
  1081. end
  1082. end)
  1083.  
  1084. mouse.KeyDown:connect(function(Press)
  1085. Press=Press:lower()
  1086. if Press=='c' then
  1087. id = 1191722766
  1088. theme.SoundId = "rbxassetid://"..id
  1089. theme:Play()
  1090. end
  1091. end)
  1092.  
  1093. mouse.KeyDown:connect(function(Press)
  1094. Press=Press:lower()
  1095. if Press=='v' then
  1096. id = 2377141094
  1097. theme.SoundId = "rbxassetid://"..id
  1098. theme:Play()
  1099. end
  1100. end)
  1101.  
  1102. mouse.KeyDown:connect(function(Press)
  1103. Press=Press:lower()
  1104. if Press=='b' then
  1105. id = 1129466633
  1106. theme.SoundId = "rbxassetid://"..id
  1107. theme:Play()
  1108. end
  1109. end)
  1110.  
  1111. mouse.KeyDown:connect(function(Press)
  1112. Press=Press:lower()
  1113. if Press=='n' then
  1114. id = 1117396305
  1115. theme.SoundId = "rbxassetid://"..id
  1116. theme:Play()
  1117. end
  1118. end)
  1119.  
  1120. mouse.KeyDown:connect(function(Press)
  1121. Press=Press:lower()
  1122. if Press=='m' then
  1123. id = 991980152
  1124. theme.SoundId = "rbxassetid://"..id
  1125. theme:Play()
  1126. end
  1127. end)
  1128.  
  1129. mouse.KeyDown:connect(function(Press)
  1130. Press=Press:lower()
  1131. if Press=='x' then
  1132. id = 2279080577
  1133. theme.SoundId = "rbxassetid://"..id
  1134. theme:Play()
  1135. end
  1136. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement