kaualima12

Untitled

Oct 9th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. wait(0.2)
  154.  
  155. print([[
  156. ___________________________________
  157.  
  158. Booty Offender // A Kyutatsuki13's script
  159. Build 0001
  160. Credit to Ethanhong that gave me this idea ;)
  161. https://discord.gg/DueqyJ8
  162.  
  163. ___________________________________
  164. ]])
  165.  
  166. warn("You're whitelisted, "..game:GetService("Players").LocalPlayer.Name.." :)")
  167.  
  168. local p = game:GetService("Players").LocalPlayer
  169. local char = p.Character
  170. local mouse = p:GetMouse()
  171. local larm = char:WaitForChild("Left Arm")
  172. local rarm = char:WaitForChild("Right Arm")
  173. local lleg = char:WaitForChild("Left Leg")
  174. local rleg = char:WaitForChild("Right Leg")
  175. local hed = char:WaitForChild("Head")
  176. local torso = char:WaitForChild("Torso")
  177. local root = char:WaitForChild("HumanoidRootPart")
  178. local hum = char:FindFirstChildOfClass("Humanoid")
  179. local debris = game:GetService("Debris")
  180. local input = game:GetService("UserInputService")
  181. local run = game:GetService("RunService")
  182. local rs = run.RenderStepped
  183. local wingpose = "Idle"
  184. local DebrisModel = Instance.new("Model",char)
  185. DebrisModel.Name = "Debris"
  186. repeat rs:wait() until p.CharacterAppearanceLoaded
  187.  
  188. noidle = false
  189. shift = false
  190. control = false
  191.  
  192. ----------------------------------------------------------------------------
  193.  
  194. function rswait(value)
  195. if value ~= nil and value ~= 0 then
  196. for i=1,value do
  197. rs:wait()
  198. end
  199. else
  200. rs:wait()
  201. end
  202. end
  203.  
  204. ----------------------------------------------------------------------------
  205.  
  206. local timeposition = 0
  207.  
  208. function music(id)
  209. if id == "Stop" then
  210. if not torso:FindFirstChild("MusicRuin") then
  211. soundz = Instance.new("Sound",torso)
  212. end
  213. soundz:Stop()
  214. else
  215. if not torso:FindFirstChild("MusicRuin") then
  216. soundz = Instance.new("Sound",torso)
  217. for i=1,2 do
  218. local equalizer = Instance.new("EqualizerSoundEffect",soundz)
  219. equalizer.HighGain = 6
  220. equalizer.MidGain = 0
  221. equalizer.LowGain = 6
  222. end
  223. end
  224. soundz.Volume = 10
  225. soundz.Name = "MusicRuin"
  226. soundz.Looped = true
  227. soundz.PlaybackSpeed = 1
  228. soundz.SoundId = "rbxassetid://"..id
  229. soundz:Stop()
  230. soundz:Play()
  231. end
  232. end
  233.  
  234. ----------------------------------------------------------------------------
  235.  
  236. function lerp(a, b, t)
  237. return a + (b - a)*t
  238. end
  239.  
  240. ----------------------------------------------------------------------------
  241.  
  242. function Lerp(c1,c2,al)
  243. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  244. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  245. for i,v in pairs(com1) do
  246. com1[i] = v+(com2[i]-v)*al
  247. end
  248. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  249. end
  250.  
  251. ----------------------------------------------------------------------------
  252.  
  253. function slerp(a, b, t)
  254. dot = a:Dot(b)
  255. if dot > 0.99999 or dot < -0.99999 then
  256. return t <= 0.5 and a or b
  257. else
  258. r = math.acos(dot)
  259. return (a*math.sin((1 - t)*r) + b*math.sin(t*r)) / math.sin(r)
  260. end
  261. end
  262.  
  263. ----------------------------------------------------------------------------
  264.  
  265. function clerp(c1,c2,al)
  266.  
  267. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  268.  
  269. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  270.  
  271. for i,v in pairs(com1) do
  272.  
  273. com1[i] = lerp(v,com2[i],al)
  274.  
  275. end
  276.  
  277. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  278.  
  279. end
  280.  
  281. ----------------------------------------------------------------------------
  282.  
  283. function findAllNearestTorso(pos,dist)
  284. local list = workspace:children()
  285. local torso = {}
  286. local temp = nil
  287. local human = nil
  288. local temp2 = nil
  289. for x = 1, #list do
  290. temp2 = list[x]
  291. if (temp2.className == "Model") and (temp2 ~= char) then
  292. temp = temp2:findFirstChild("Torso")
  293. human = temp2:findFirstChildOfClass("Humanoid")
  294. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  295. if (temp.Position - pos).magnitude < dist then
  296. table.insert(torso,temp)
  297. dist = (temp.Position - pos).magnitude
  298. end
  299. end
  300. end
  301. end
  302. return torso
  303. end
  304.  
  305. ----------------------------------------------------------------------------
  306.  
  307. function checkIfNotPlayer(model)
  308. if model.CanCollide == true and model ~= char and model.Parent ~= char and model.Parent.Parent ~= char and model.Parent.Parent ~= char and model.Parent ~= DebrisModel and model.Parent.Parent ~= DebrisModel and model.Parent.Parent.Parent ~= DebrisModel and model ~= wings and model.Parent ~= wings and model.Parent.Parent ~= wings then
  309. return true
  310. else
  311. return false
  312. end
  313. end
  314.  
  315. ----------------------------------------------------------------------------
  316.  
  317. function newWeld(wp0, wp1, wc0x, wc0y, wc0z)
  318.  
  319. local wld = Instance.new("Weld", wp1)
  320.  
  321. wld.Part0 = wp0
  322.  
  323. wld.Part1 = wp1
  324.  
  325. wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
  326.  
  327. return wld
  328.  
  329. end
  330.  
  331. function weld(model)
  332. local parts,last = {}
  333. local function scan(parent)
  334. for _,v in pairs(parent:GetChildren()) do
  335. if (v:IsA("BasePart")) then
  336. if (last) then
  337. local w = Instance.new("Weld")
  338. w.Name = ("%s_Weld"):format(v.Name)
  339. w.Part0,w.Part1 = last,v
  340. w.C0 = last.CFrame:inverse()
  341. w.C1 = v.CFrame:inverse()
  342. w.Parent = last
  343. end
  344. last = v
  345. table.insert(parts,v)
  346. end
  347. scan(v)
  348. end
  349. end
  350. scan(model)
  351. for _,v in pairs(parts) do
  352. v.Anchored = false
  353. v.Locked = true
  354. v.Anchored = false
  355. v.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  356. v.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  357. v.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  358. v.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  359. v.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  360. v.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  361. v.CustomPhysicalProperties = PhysicalProperties.new(0,0,0)
  362. end
  363. end
  364.  
  365. ----------------------------------------------------------------------------
  366.  
  367. function calculate(part,asd)
  368. local Head = hed
  369. local RightShoulder = asd
  370. local RightArm = part
  371. local MousePosition = mouse.Hit.p
  372. local ToMouse = (MousePosition - Head.Position).unit
  373. local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
  374. local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (RightArm.Size.X / 2)), ((Head.Size.Y / 2) - (RightArm.Size.Z / 2)), 0)))
  375. local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit
  376. local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
  377. local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
  378. if tostring(LateralAngle) == "-1.#IND" then
  379. LateralAngle = 0
  380. end
  381. local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
  382. if LateralAngle > (math.pi / 2) then
  383. LateralAngle = (math.pi / 2)
  384. local Torso = root
  385. local Point = Torso.CFrame:vectorToObjectSpace(mouse.Hit.p-Torso.CFrame.p)
  386. if Point.Z > 0 then
  387. if Point.X > -0 and RightArm == rarm then
  388. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(110),0)
  389. elseif Point.X < 0 and RightArm == rarm then
  390. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(-110),0)
  391. end
  392. end
  393. end
  394. if Cross.Y < 0 then
  395. LateralAngle = -LateralAngle
  396. end
  397. return(CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
  398. end
  399.  
  400. ----------------------------------------------------------------------------
  401.  
  402. function sound(id,position,vol,pitch,start,finish)
  403. coroutine.resume(coroutine.create(function()
  404.  
  405. local part = Instance.new("Part",workspace)
  406. part.Position = position
  407. part.Size = Vector3.new(0,0,0)
  408. part.CanCollide = false
  409. part.Transparency = 1
  410.  
  411. local sound = Instance.new("Sound",part)
  412.  
  413. sound.SoundId = "rbxassetid://"..id
  414.  
  415. repeat rs:wait() until sound.IsLoaded
  416.  
  417. if vol ~= nil then
  418. sound.Volume = vol
  419. end
  420.  
  421. if pitch ~= nil then
  422. sound.PlaybackSpeed = pitch
  423. end
  424.  
  425. if start ~= nil then
  426. sound.TimePosition = start
  427. end
  428.  
  429. if finish ~= nil then
  430. debris:AddItem(part,finish-start)
  431. else
  432. debris:AddItem(part,sound.TimeLength)
  433. end
  434.  
  435. sound:Play()
  436.  
  437. return sound
  438.  
  439. end))
  440. end
  441.  
  442. ----------------------------------------------------------------------------
  443.  
  444. function computeDirection(vec)
  445. local lenSquared = vec.magnitude * vec.magnitude
  446. local invSqrt = 1 / math.sqrt(lenSquared)
  447. return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
  448. end
  449.  
  450. ----------------------------------------------------------------------------
  451.  
  452. local shaking = 0
  453. function shake(num) if num > shaking then shaking = num end end
  454. game:GetService("RunService").RenderStepped:connect(function()
  455. hum.CameraOffset = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))*(shaking/100)
  456. if shaking > 0 then shaking = shaking - 1 else shaking = 0 end
  457. end)
  458.  
  459. plr = game:GetService("Players").LocalPlayer
  460. DebrisModel = Instance.new("Model",plr.Character)
  461. DebrisModel.Name = "DebrisModel"
  462.  
  463. function Effect(mesh,size,transparency,material,color,position,rotation,positionchange,sizechange,rotationchange,transparencychange,acceleration)
  464.  
  465. local part = Instance.new("Part",DebrisModel)
  466. part.Anchored = true
  467. part.CanCollide = false
  468. part.Size = Vector3.new(1,1,1)
  469. part.Transparency = transparency
  470. part.Material = material
  471. part.Color = color
  472. part.CFrame = CFrame.new(position)*CFrame.Angles(math.rad(rotation.X),math.rad(rotation.Y),math.rad(rotation.Z))
  473.  
  474. local partmesh = Instance.new("SpecialMesh",part)
  475. if tonumber(mesh) == nil then partmesh.MeshType = mesh else partmesh.MeshId = "rbxassetid://"..mesh end
  476. partmesh.Scale = size
  477.  
  478. local pvalue = Instance.new("Vector3Value",part)
  479. pvalue.Name = "Position"
  480. pvalue.Value = positionchange
  481.  
  482. local svalue = Instance.new("Vector3Value",part)
  483. svalue.Name = "Size"
  484. svalue.Value = sizechange
  485.  
  486. local rvalue = Instance.new("Vector3Value",part)
  487. rvalue.Name = "Rotation"
  488. rvalue.Value = rotationchange
  489.  
  490. local tvalue = Instance.new("NumberValue",part)
  491. tvalue.Name = "Transparency"
  492. tvalue.Value = transparencychange
  493.  
  494. local avalue = Instance.new("NumberValue",part)
  495. avalue.Name = "Acceleration"
  496. avalue.Value = acceleration
  497.  
  498. part.Name = "EFFECT"
  499.  
  500. return part
  501.  
  502. end
  503.  
  504. game:GetService("RunService").RenderStepped:connect(function()
  505. coroutine.resume(coroutine.create(function()
  506.  
  507. for i, v in pairs(DebrisModel:GetChildren()) do
  508. if v:isA("BasePart") then
  509. v.LocalTransparencyModifier = 0
  510. end
  511. end
  512.  
  513. if not plr.Character:FindFirstChild("DebrisModel") then
  514. DebrisModel = Instance.new("Model",plr.Character)
  515. DebrisModel.Name = "DebrisModel"
  516. end
  517.  
  518. for i,v in pairs(DebrisModel:GetChildren()) do
  519. if v:IsA("BasePart") and v.Name == "EFFECT" then
  520. local pvalue = v:FindFirstChild("Position").Value
  521. local svalue = v:FindFirstChild("Size").Value
  522. local rvalue = v:FindFirstChild("Rotation").Value
  523. local tvalue = v:FindFirstChild("Transparency").Value
  524. local avalue = v:FindFirstChild("Acceleration").Value
  525. local mesh = v:FindFirstChild("Mesh")
  526. mesh.Scale = mesh.Scale + svalue
  527. v:FindFirstChild("Size").Value = v:FindFirstChild("Size").Value + (Vector3.new(1,1,1)*avalue)
  528. v.Transparency = v.Transparency + tvalue
  529. v.CFrame = CFrame.new(pvalue)*v.CFrame*CFrame.Angles(math.rad(rvalue.X),math.rad(rvalue.Y),math.rad(rvalue.Z))
  530. if v.Transparency >= 1 or mesh.Scale.X < 0 or mesh.Scale.Y < 0 or mesh.Scale.Z < 0 then
  531. v:Destroy()
  532. end
  533. end
  534. end
  535.  
  536. end))
  537. end)
  538.  
  539. local wsback = 0
  540. local frozen = false
  541. function freeze()
  542. if frozen == false then
  543. frozen = true
  544. wsback = hum.WalkSpeed
  545. hum.WalkSpeed = 1
  546. else
  547. frozen = false
  548. hum.WalkSpeed = wsback
  549. end
  550. end
  551. hum.WalkSpeed = 25
  552.  
  553. function Lightning(Part0,Part1,Times,Offset,Color,Thickness,Trans)
  554. local magz = (Part0 - Part1).magnitude
  555. local curpos = Part0
  556. local trz = {-Offset,Offset}
  557. for i=1,Times do
  558. local li = Instance.new("Part", DebrisModel)
  559. li.TopSurface =0
  560. li.Material = Enum.Material.Neon
  561. li.BottomSurface = 0
  562. li.Anchored = true
  563. li.Locked = true
  564. li.Transparency = Trans or 0.4
  565. li.Color = Color
  566. li.formFactor = "Custom"
  567. li.CanCollide = false
  568. li.Size = Vector3.new(Thickness,Thickness,magz/Times)
  569. local lim = Instance.new("BlockMesh",li)
  570. local Offzet = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  571. local trolpos = CFrame.new(curpos,Part1)*CFrame.new(0,0,magz/Times).p+Offzet
  572. if Times == i then
  573. local magz2 = (curpos - Part1).magnitude
  574. li.Size = Vector3.new(Thickness,Thickness,magz2)
  575. li.CFrame = CFrame.new(curpos,Part1)*CFrame.new(0,0,-magz2/2)
  576. else
  577. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
  578. end
  579. curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p
  580. li.Name = "LIGHTNING"
  581. end
  582. end
  583.  
  584. ----------------------------------------------------------------------------
  585. skin_color = BrickColor.new("Light orange")
  586. --p:ClearCharacterAppearance()
  587. --hed:WaitForChild("face"):Destroy()
  588. hed:WaitForChild("face").Texture = "rbxassetid://407320095"
  589. ----------------------------------------------------------------------------
  590. local size = 1
  591.  
  592. newWeld(torso, larm, -1.5, 0.5, 0)
  593. larm.Weld.C1 = CFrame.new(0, 0.5, 0)
  594. newWeld(torso, rarm, 1.5, 0.5, 0)
  595. rarm.Weld.C1 = CFrame.new(0, 0.5, 0)
  596. newWeld(torso, hed, 0, 1.5, 0)
  597. newWeld(torso, lleg, -0.5, -1, 0)
  598. lleg.Weld.C1 = CFrame.new(0, 1, 0)
  599. newWeld(torso, rleg, 0.5, -1, 0)
  600. rleg.Weld.C1 = CFrame.new(0, 1, 0)
  601. newWeld(root, torso, 0, -1, 0)
  602. torso.Weld.C1 = CFrame.new(0, -1, 0)
  603.  
  604. emitters={}
  605.  
  606. ----------------------------------------------------------------------------------------
  607. music(288494027)
  608. velocityYFall=0
  609. velocityYFall2=0
  610. velocityYFall3=0
  611. velocityYFall4=0
  612. neckrotY=0
  613. neckrotY2=0
  614. torsorotY=0
  615. torsorotY2=0
  616. torsoY=0
  617. torsoY2=0
  618. colored = 0
  619. sine = 0
  620. change=0.4
  621. movement=10
  622. timeranim=0
  623. running = false
  624. jumped = false
  625. icolor=1
  626. imode=false
  627.  
  628. didjump = false
  629. jumppower = 0
  630. debounceimpact = false
  631.  
  632. function jumpimpact()
  633. if debounceimpact == false then
  634. debounceimpact = true
  635. if jumppower < -150 then jumppower = -150 end
  636. shake(-jumppower/5)
  637. for i=1,-jumppower/20 do rs:wait()
  638. hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(0,0,0), 0.05)
  639. torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, (jumppower/20)-hum.HipHeight, 0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.05)
  640. end
  641. debounceimpact = false
  642. end
  643. end
  644.  
  645. max = 0
  646.  
  647. rs:connect(function()
  648.  
  649. for i,v in pairs(DebrisModel:GetChildren()) do
  650. if v.Name == "LIGHTNING" then
  651. local vm = v:FindFirstChildOfClass("BlockMesh")
  652. vm.Scale = vm.Scale - Vector3.new(0.1,0.1,0)
  653. if vm.Scale.X <= 0 then
  654. v:Destroy()
  655. end
  656. end
  657. end
  658.  
  659. if p.Character.Parent == nil then
  660. local model = Instance.new("Model")
  661. model.Name = p.Name
  662. p.Character = model
  663. for i,v in pairs(char:GetChildren()) do
  664. v.Parent = p.Character
  665. end
  666. end
  667.  
  668. char = p.Character
  669. if p.Character.Parent ~= workspace then
  670. p.Character.Parent = workspace
  671. end
  672. for i,v in pairs(char:GetChildren()) do
  673. if v:IsA("Accoutrement") then
  674. if v.Handle:FindFirstChild("Mesh") then
  675. v.Handle:FindFirstChild("Mesh").Offset = Vector3.new()
  676. v.Handle.Transparency = 0
  677. end
  678. elseif v:IsA("BasePart") then
  679. v.Anchored = false
  680. if v:FindFirstChildOfClass("BodyPosition") then
  681. v:FindFirstChildOfClass("BodyPosition"):Destroy()
  682. end
  683. if v:FindFirstChildOfClass("BodyVelocity") then
  684. v:FindFirstChildOfClass("BodyVelocity"):Destroy()
  685. end
  686. if v:FindFirstChildOfClass("BodyGyro") and v:FindFirstChildOfClass("BodyGyro").Name ~= "lolnochara" then
  687. v:FindFirstChildOfClass("BodyGyro"):Destroy()
  688. end
  689. if v:FindFirstChild("Mesh") then
  690. v:FindFirstChild("Mesh").Offset = Vector3.new()
  691. end
  692. if not DebrisModel:FindFirstChild(v.Name.."FORCEFIELD") then
  693. local force = Instance.new("Part",DebrisModel)
  694. force.Name = v.Name.."FORCEFIELD"
  695. if v ~= hed then
  696. force.Size = v.Size+(Vector3.new(1,1,1)*0.2)
  697. else
  698. force.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2)
  699. end
  700. force.CanCollide = false
  701. force.Transparency = 1
  702. force.Color = Color3.new(0,1,1)
  703. force.Material = Enum.Material.Neon
  704. newWeld(v,force,0,0,0)
  705. else
  706. if not DebrisModel:FindFirstChild(v.Name.."FORCEFIELD"):FindFirstChildOfClass("Weld") then
  707. newWeld(v,DebrisModel:FindFirstChild(v.Name.."FORCEFIELD"),0,0,0)
  708. end
  709. end
  710. if v.Name ~= "HumanoidRootPart" then
  711. v.Transparency = 0
  712. else
  713. v.Transparency = 1
  714. end
  715. end
  716. end
  717.  
  718. if -root.Velocity.Y/1.5 > -5 and -root.Velocity.Y/1.5 < 150 then
  719. velocityYFall = root.Velocity.Y/1.5
  720. else
  721. if -root.Velocity.Y/1.5 < -5 then
  722. velocityYFall = 5
  723. elseif -root.Velocity.Y/1.5 > 150 then
  724. velocityYFall = -150
  725. end
  726. end
  727.  
  728. if -root.Velocity.Y/180 > 0 and -root.Velocity.Y/180 < 1.2 then
  729. velocityYFall2 = root.Velocity.Y/180
  730. else
  731. if -root.Velocity.Y/180 < 0 then
  732. velocityYFall2 = 0
  733. elseif -root.Velocity.Y/180 > 1.2 then
  734. velocityYFall2 = -1.2
  735. end
  736. end
  737.  
  738. if -root.Velocity.Y/1.5 > -5 and -root.Velocity.Y/1.5 < 50 then
  739. velocityYFall3 = root.Velocity.Y/1.5
  740. else
  741. if -root.Velocity.Y/1.5 < -5 then
  742. velocityYFall3 = 5
  743. elseif -root.Velocity.Y/1.5 > 50 then
  744. velocityYFall3 = -50
  745. end
  746. end
  747.  
  748. if -root.Velocity.Y/1.5 > -50 and -root.Velocity.Y/1.5 < 20 then
  749. velocityYFall4 = root.Velocity.Y/1.5
  750. else
  751. if -root.Velocity.Y/180 < -5 then
  752. velocityYFall4 = 5
  753. elseif -root.Velocity.Y/180 > 50 then
  754. velocityYFall4 = -50
  755. end
  756. end
  757.  
  758. if root.RotVelocity.Y/6 < 1 and root.RotVelocity.Y/6 > -1 then
  759. neckrotY = root.RotVelocity.Y/6
  760. else
  761. if root.RotVelocity.Y/6 < -1 then
  762. neckrotY = -1
  763. elseif root.RotVelocity.Y/6 > 1 then
  764. neckrotY = 1
  765. end
  766. end
  767.  
  768. if root.RotVelocity.Y/8 < 0.6 and root.RotVelocity.Y/8 > -0.6 then
  769. neckrotY2 = root.RotVelocity.Y/8
  770. else
  771. if root.RotVelocity.Y/8 < -0.6 then
  772. neckrotY2 = -0.6
  773. elseif root.RotVelocity.Y/8 > 0.6 then
  774. neckrotY2 = 0.6
  775. end
  776. end
  777.  
  778. if root.RotVelocity.Y/6 < 0.2 and root.RotVelocity.Y/6 > -0.2 then
  779. torsorotY = root.RotVelocity.Y/6
  780. else
  781. if root.RotVelocity.Y/6 < -0.2 then
  782. torsorotY = -0.2
  783. elseif root.RotVelocity.Y/6 > 0.2 then
  784. torsorotY = 0.2
  785. end
  786. end
  787.  
  788. if root.RotVelocity.Y/8 < 0.2 and root.RotVelocity.Y/8 > -0.2 then
  789. torsorotY2 = root.RotVelocity.Y/8
  790. else
  791. if root.RotVelocity.Y/8 < -0.2 then
  792. torsorotY2 = -0.2
  793. elseif root.RotVelocity.Y/8 > 0.2 then
  794. torsorotY2 = 0.2
  795. end
  796. end
  797.  
  798. torsoY = -(torso.Velocity*Vector3.new(1, 0, 1)).magnitude/20
  799. torsoY2 = -(torso.Velocity*Vector3.new(1, 0, 1)).magnitude/36
  800.  
  801. local ray1 = Ray.new(root.Position+Vector3.new(size,0,0),Vector3.new(0, -4, 0))
  802. local part1, endPoint = workspace:FindPartOnRay(ray1, char)
  803.  
  804. local ray2 = Ray.new(root.Position-Vector3.new(size,0,0),Vector3.new(0, -4, 0))
  805. local part2, endPoint = workspace:FindPartOnRay(ray2, char)
  806.  
  807. local ray3 = Ray.new(root.Position+Vector3.new(0,0,size/2),Vector3.new(0, -4, 0))
  808. local part3, endPoint = workspace:FindPartOnRay(ray3, char)
  809.  
  810. local ray4 = Ray.new(root.Position-Vector3.new(0,0,size/2),Vector3.new(0, -4, 0))
  811. local part4, endPoint = workspace:FindPartOnRay(ray4, char)
  812.  
  813. local ray5 = Ray.new(root.Position+Vector3.new(size,0,size/2),Vector3.new(0, -4, 0))
  814. local part5, endPoint = workspace:FindPartOnRay(ray5, char)
  815.  
  816. local ray6 = Ray.new(root.Position-Vector3.new(size,0,size/2),Vector3.new(0, -4, 0))
  817. local part6, endPoint = workspace:FindPartOnRay(ray6, char)
  818.  
  819. local ray7 = Ray.new(root.Position+Vector3.new(size,0,-size/2),Vector3.new(0, -4, 0))
  820. local part7, endPoint = workspace:FindPartOnRay(ray7, char)
  821.  
  822. local ray8 = Ray.new(root.Position-Vector3.new(size,0,-size/2),Vector3.new(0, -4, 0))
  823. local part8, endPoint = workspace:FindPartOnRay(ray8, char)
  824.  
  825. local ray = Ray.new(root.Position,Vector3.new(0, -6, 0))
  826. local part, endPoint = workspace:FindPartOnRay(ray, char)
  827.  
  828. if part1 or part2 or part3 or part4 or part5 or part6 or part7 or part8 then jumped = false else endPoint = 0 jumped = true end
  829.  
  830. local rlegray = Ray.new(rleg.Position+Vector3.new(0,size/2,0),Vector3.new(0, -1.75, 0))
  831. local rlegpart, rlegendPoint = workspace:FindPartOnRay(rlegray, char)
  832.  
  833. local llegray = Ray.new(lleg.Position+Vector3.new(0,size/2,0),Vector3.new(0, -1.75, 0))
  834. local llegpart, llegendPoint = workspace:FindPartOnRay(llegray, char)
  835.  
  836. if hum.Health > 0 and noidle == false then
  837. if hum.Sit == false then
  838. if (torso.Velocity*Vector3.new(1, 0, 1)).magnitude >= 5 and jumped == false then
  839. hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.2) * CFrame.Angles(math.rad((torso.Velocity*Vector3.new(1, 0, 1)).magnitude/35),torsorotY, math.rad(0)+torsorotY), 0.4)
  840. hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles((change/10)*math.cos(sine/2)+0.1,-(change/10)*math.cos(sine/4)-(torsorotY/5),(change/5)*math.cos(sine/4)), 0.1)
  841. rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.62-(movement/40)*math.cos(sine/4)/3,(movement/150)+(movement/40)*math.cos(sine/4))*CFrame.Angles(math.rad(-5-(movement*2)*math.cos(sine/4))+ -(movement/10)*math.sin(sine/4)*2,math.rad(0-(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2)
  842. larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.62+(movement/40)*math.cos(sine/4)/3,(movement/150)-(movement/40)*math.cos(sine/4))*CFrame.Angles(math.rad(-5+(movement*2)*math.cos(sine/4))+ (movement/10)*math.sin(sine/4)*2,math.rad(0-(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2)
  843. torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -0.5+(change*2)*math.sin(sine/2), 0) * CFrame.Angles(math.rad(30+(change*20)-(movement/20)*math.cos(sine/2)), torsorotY2+math.rad(0-20*math.sin(sine/4)), torsorotY2+math.rad(0-1*math.cos(sine/4))), 0.1)
  844. lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5,(-0.85-(movement/15)*math.cos(sine/4)/2),-0.1+(movement/15)*math.cos(sine/4))*CFrame.Angles(math.rad(-50+(change*5)-movement*math.cos(sine/4))+ -(movement/10)*math.sin(sine/4),math.rad(0+(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2)
  845. rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5,(-0.85+(movement/15)*math.cos(sine/4)/2),-0.1-(movement/15)*math.cos(sine/4))*CFrame.Angles(math.rad(-50+(change*5)+movement*math.cos(sine/4))+ (movement/10)*math.sin(sine/4),math.rad(0+(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2)
  846. elseif jumped == true then
  847. didjump = true
  848. jumppower = root.Velocity.Y
  849. hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.1) * CFrame.Angles(0,0,0), 0.4)
  850. hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(0,0,0), 0.1)
  851. larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.55,0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1)
  852. rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.55,0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1)
  853. torso.Weld.C0 = CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(math.random(-90,90)),math.rad(0), math.rad(math.random(-180,180)))
  854. lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5,-0.925,0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1)
  855. rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5,0,-0.8) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1)
  856. elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 5 then
  857. hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.1), 0.4)
  858. hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(math.rad(0+50*math.sin(sine/4)),0,0), 0.1)
  859. larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.55,-0.05-0.2*math.cos(sine/4))*CFrame.Angles(math.rad(0+80*math.sin(sine/4)),math.rad(-5-5*math.sin(sine/8)),math.rad(-6+2*math.cos(sine/8))), 0.2)
  860. rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.55,-0.05-0.2*math.cos(sine/4))*CFrame.Angles(math.rad(0+80*math.sin(sine/4)),math.rad(5+5*math.sin(sine/8)),math.rad(6-2*math.cos(sine/8))), 0.2)
  861. torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1.1-hum.HipHeight, 0+2*math.cos(sine/4)) * CFrame.Angles(math.rad(0-80*math.cos(sine/4)),math.rad(0), math.rad(0-1*math.cos(sine/32))), 0.1)
  862. lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(0,llegendPoint.Y-lleg.Position.Y,0)*CFrame.new(-0.5,0,0)*CFrame.Angles(math.rad(0+120*math.cos(sine/4)),math.rad(10),math.rad(-5+1*math.cos(sine/16))), 0.1)
  863. rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0,rlegendPoint.Y-rleg.Position.Y,0)*CFrame.new(0.5,0,0)*CFrame.Angles(math.rad(0+120*math.cos(sine/4)),math.rad(-10),math.rad(5+1*math.cos(sine/16))), 0.1)
  864. end
  865.  
  866. else
  867. hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.1), 0.4)
  868. hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(0.05*math.sin(sine/16)+0.15,0.05*math.cos(sine/32),0.01*math.cos(sine/32)), 0.1)
  869. larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.55-(0.1)*math.cos(sine/16)/3,-0.05-0.1*math.cos(sine/16))*CFrame.Angles(math.rad(-2+4*math.sin(sine/16)),math.rad(-5-5*math.sin(sine/16)),math.rad(-6+2*math.cos(sine/16))), 0.2)
  870. rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.55-(0.1)*math.cos(sine/16)/3,-0.05-0.1*math.cos(sine/16))*CFrame.Angles(math.rad(-2+4*math.sin(sine/16)),math.rad(5+5*math.sin(sine/16)),math.rad(6-2*math.cos(sine/16))), 0.2)
  871. torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1.4-(0.1)*math.cos(sine/16)-hum.HipHeight, 0) * CFrame.Angles(math.rad(0-2*math.cos(sine/16)),math.rad(0), math.rad(0-1*math.cos(sine/32))), 0.1)
  872. lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5,-0.55+(0.1)*math.cos(sine/16),0)*CFrame.Angles(math.rad(80+2*math.cos(sine/16)),math.rad(4),math.rad(-2+1*math.cos(sine/32))), 0.2)
  873. rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5,-0.55+(0.1)*math.cos(sine/16),0)*CFrame.Angles(math.rad(80+2*math.cos(sine/16)),math.rad(-4),math.rad(2+1*math.cos(sine/32))), 0.2)
  874. end
  875.  
  876. end
  877. if didjump == true and jumped == false and jumppower < 0 then
  878. didjump = false
  879. jumpimpact()
  880. end
  881.  
  882. sine = sine + change
  883. hum.Health = math.huge
  884. hum.MaxHealth = math.huge
  885. end)
Advertisement
Add Comment
Please, Sign In to add comment