Advertisement
samuelrichter66

gangstas hedgehog paradise

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