Advertisement
HenloMyDude

WIP

Jun 17th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.45 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. warn("Rainbow by HenloMyDude")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local Mouse = Player:GetMouse()
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84.  
  85. ----Sandboxed game object that allows the usage of client-side methods and services
  86. --Real game object
  87. local _rg = game
  88.  
  89. --Metatable for fake service
  90. local fsmt = {
  91. __index = function(self,k)
  92. local s = rawget(self,"_RealService")
  93. if s then return s[k] end
  94. end,
  95. __newindex = function(self,k,v)
  96. local s = rawget(self,"_RealService")
  97. if s then s[k]=v end
  98. end,
  99. __call = function(self,...)
  100. local s = rawget(self,"_RealService")
  101. if s then return s(...) end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return self[s]
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. }
  120. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121. g.service = g.GetService
  122.  
  123. g.RunService = FakeService({
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126.  
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132.  
  133. setmetatable(g,{
  134. __index=function(self,s)
  135. return _rg:GetService(s) or typeof(_rg[s])=="function"
  136. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137. end,
  138. __newindex = fsmt.__newindex,
  139. __call = fsmt.__call
  140. })
  141. --Changing owner to fake player object to support owner:GetMouse()
  142. game,owner = g,g.Players.LocalPlayer
  143. end
  144.  
  145. local cansilence = true
  146.  
  147. function SHUTUPXDD()
  148. if cansilence then
  149. cansilence = false
  150. local function search(instance)
  151. for i,v in pairs(instance:GetChildren()) do
  152. search(v)
  153. if v.ClassName == "Sound" then
  154. if v.Parent ~= game.Players.LocalPlayer.Character then
  155. v.Volume = 0
  156. end
  157. end
  158. end
  159. end
  160. search(workspace)
  161. wait(3)
  162. cansilence = false
  163. end
  164. end
  165.  
  166. game:GetService("RunService").RenderStepped:connect(SHUTUPXDD)
  167.  
  168. Player_Size = 1 --Size of the player.
  169.  
  170. wait()
  171. local Player = owner
  172. local Character = Player.Character
  173. local plr = owner
  174. local Humanoid = Character.Humanoid
  175. local char = plr.Character
  176. local hum = char.Humanoid
  177. local ra = char["Right Arm"]
  178. local la= char["Left Arm"]
  179. local rl= char["Right Leg"]
  180. local ll = char["Left Leg"]
  181. local hed = char.Head
  182. local root = char.HumanoidRootPart
  183. local rootj = root.RootJoint
  184. local tors = char.Torso
  185. local LeftArm = Character["Left Arm"]
  186. local RightArm = Character["Right Arm"]
  187. local LeftLeg = Character["Left Leg"]
  188. local RightLeg = Character["Right Leg"]
  189. local Head = Character.Head
  190. local Torso = Character.Torso
  191. local mouse = plr:GetMouse()
  192. local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  193. local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
  194. local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
  195. local cam = game.Workspace.CurrentCamera
  196. trazx = Instance.new("ParticleEmitter")
  197. local sine=0
  198.  
  199. hum.MaxHealth = "Inf"
  200. hum.Health = "Inf"
  201.  
  202. local forcefield = Instance.new("ForceField",char)
  203. forcefield.Name = "obama"
  204. forcefield.Visible = false
  205.  
  206. -------------------------------------------------------
  207. CF = CFrame.new
  208. angles = CFrame.Angles
  209. attack = false
  210. timetofly = true
  211. Euler = CFrame.fromEulerAnglesXYZ
  212. Rad = math.rad
  213. IT = Instance.new
  214. BrickC = BrickColor.new
  215. Cos = math.cos
  216. Acos = math.acos
  217. Sin = math.sin
  218. Asin = math.asin
  219. Abs = math.abs
  220. Mrandom = math.random
  221. Floor = math.floor
  222. random = math.random
  223. radian = math.rad
  224. Vec3 = Vector3.new
  225. cFrame = CFrame.new
  226. Euler = CFrame.fromEulerAnglesXYZ
  227. -------------------------------------------------------
  228.  
  229. necko = CF(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  230. RW = Instance.new("Weld")
  231. LW = Instance.new("Weld")
  232. RH = tors["Right Hip"]
  233. LH = tors["Left Hip"]
  234. RW.Name = "RW"
  235. RW.Part0 = tors
  236. RW.C0 = CF(1.5, 0.5, 0)
  237. RW.C1 = CF(0, 0.5, 0)
  238. RW.Part1 = ra
  239. RW.Parent = tors
  240. LW.Name = "LW"
  241. LW.Part0 = tors
  242. LW.C0 = CF(-1.5, 0.5, 0)
  243. LW.C1 = CF(0, 0.5, 0)
  244. LW.Part1 = la
  245. LW.Parent = tors
  246. Effects = {}
  247.  
  248. -------------------------------------------------------
  249. h = char.Head
  250. t = char.Torso
  251. nec = tors.Neck
  252. rut = char.HumanoidRootPart
  253. rutj = rut.RootJoint
  254. it = Instance.new
  255.  
  256. attack = false
  257.  
  258. function SoulSteal(dude)
  259. if dude.Name ~= char then
  260. local bgf = IT("BodyGyro", dude.Head)
  261. bgf.CFrame = bgf.CFrame * CFrame.fromEulerAnglesXYZ(Rad(-90), 0, 0)
  262. local val = IT("BoolValue", dude)
  263. val.Name = "IsHit"
  264. local torso = (dude:FindFirstChild'Head' or dude:FindFirstChild'Torso' or dude:FindFirstChild'UpperTorso' or dude:FindFirstChild'LowerTorso' or dude:FindFirstChild'HumanoidRootPart')
  265. local soulst = coroutine.wrap(function()
  266. local soul = Instance.new("Part",dude)
  267. soul.Size = Vector3.new(1,1,1)
  268. soul.CanCollide = false
  269. soul.Anchored = false
  270. soul.Position = torso.Position
  271. soul.Transparency = 1
  272. local PartEmmit1 = IT("ParticleEmitter", soul)
  273. PartEmmit1.LightEmission = 1
  274. PartEmmit1.Texture = "rbxassetid://569507414"
  275. PartEmmit1.Color = ColorSequence.new(maincolor.Color)
  276. PartEmmit1.Rate = 250
  277. PartEmmit1.Lifetime = NumberRange.new(1.6)
  278. PartEmmit1.Size = NumberSequence.new({
  279. NumberSequenceKeypoint.new(0, 1, 0),
  280. NumberSequenceKeypoint.new(1, 0, 0)
  281. })
  282. PartEmmit1.Transparency = NumberSequence.new({
  283. NumberSequenceKeypoint.new(0, 0, 0),
  284. NumberSequenceKeypoint.new(1, 1, 0)
  285. })
  286. PartEmmit1.Speed = NumberRange.new(0, 0)
  287. PartEmmit1.VelocitySpread = 30000
  288. PartEmmit1.Rotation = NumberRange.new(-360, 360)
  289. PartEmmit1.RotSpeed = NumberRange.new(-360, 360)
  290. local BodPoss = IT("BodyPosition", soul)
  291. BodPoss.P = 3000
  292. BodPoss.D = 1000
  293. BodPoss.maxForce = Vector3.new(50000000000, 50000000000, 50000000000)
  294. BodPoss.position = torso.Position + Vector3.new(Mrandom(-15, 15), Mrandom(-15, 15), Mrandom(-15, 15))
  295. wait(1.6)
  296. soul.Touched:connect(function(hit)
  297. if hit.Parent == char then
  298. soul:Destroy()
  299. end
  300. end)
  301. wait(1.2)
  302. while soul do
  303. swait()
  304. PartEmmit1.Color = ColorSequence.new(maincolor.Color)
  305. BodPoss.Position = tors.Position
  306. end
  307. end)
  308. soulst()
  309. end
  310. end
  311. function FaceMouse()
  312. local Cam = workspace.CurrentCamera
  313. return {
  314. CFrame.new(char.Torso.Position, Vector3.new(mouse.Hit.p.x, char.Torso.Position.y, mouse.Hit.p.z)),
  315. Vector3.new(mouse.Hit.p.x, mouse.Hit.p.y, mouse.Hit.p.z)
  316. }
  317. end
  318.  
  319. function Eviscerate(dude)
  320. if dude.Name ~= char then
  321. local bgf = IT("BodyGyro", dude.Head)
  322. bgf.CFrame = bgf.CFrame * CFrame.fromEulerAnglesXYZ(Rad(-90), 0, 0)
  323. local val = IT("BoolValue", dude)
  324. val.Name = "IsHit"
  325. local ds = coroutine.wrap(function()
  326. dude:WaitForChild("Head"):BreakJoints()
  327. wait(0.5)
  328. target = nil
  329. coroutine.resume(coroutine.create(function()
  330. for i, v in pairs(dude:GetChildren()) do
  331. if v:IsA("Accessory") then
  332. v:Destroy()
  333. end
  334. if v:IsA("Humanoid") then
  335. v:Destroy()
  336. end
  337. if v:IsA("CharacterMesh") then
  338. v:Destroy()
  339. end
  340. if v:IsA("Model") then
  341. v:Destroy()
  342. end
  343. if v:IsA("Part") or v:IsA("MeshPart") then
  344. for x, o in pairs(v:GetChildren()) do
  345. if o:IsA("Decal") then
  346. o:Destroy()
  347. end
  348. end
  349. coroutine.resume(coroutine.create(function()
  350. v.Material = "Neon"
  351. v.CanCollide = false
  352. local PartEmmit1 = IT("ParticleEmitter", v)
  353. PartEmmit1.LightEmission = 1
  354. PartEmmit1.Texture = "rbxassetid://284205403"
  355. PartEmmit1.Color = ColorSequence.new(maincolor.Color)
  356. PartEmmit1.Rate = 150
  357. PartEmmit1.Lifetime = NumberRange.new(1)
  358. PartEmmit1.Size = NumberSequence.new({
  359. NumberSequenceKeypoint.new(0, 0.75, 0),
  360. NumberSequenceKeypoint.new(1, 0, 0)
  361. })
  362. PartEmmit1.Transparency = NumberSequence.new({
  363. NumberSequenceKeypoint.new(0, 0, 0),
  364. NumberSequenceKeypoint.new(1, 1, 0)
  365. })
  366. PartEmmit1.Speed = NumberRange.new(0, 0)
  367. PartEmmit1.VelocitySpread = 30000
  368. PartEmmit1.Rotation = NumberRange.new(-500, 500)
  369. PartEmmit1.RotSpeed = NumberRange.new(-500, 500)
  370. local BodPoss = IT("BodyPosition", v)
  371. BodPoss.P = 3000
  372. BodPoss.D = 1000
  373. BodPoss.maxForce = Vector3.new(50000000000, 50000000000, 50000000000)
  374. BodPoss.position = v.Position + Vector3.new(Mrandom(-15, 15), Mrandom(-15, 15), Mrandom(-15, 15))
  375. v.Color = maincolor.Color
  376. coroutine.resume(coroutine.create(function()
  377. for i = 0, 49 do
  378. swait(1)
  379. v.Transparency = v.Transparency + 0.08
  380. end
  381. wait(0.5)
  382. PartEmmit1.Enabled = false
  383. wait(3)
  384. v:Destroy()
  385. dude:Destroy()
  386. end))
  387. end))
  388. end
  389. end
  390. end))
  391. end)
  392. ds()
  393. end
  394. end
  395.  
  396. mesh = Instance.new("SpecialMesh")
  397. mesh.Parent = Character
  398. mesh.MeshType = "Brick"
  399.  
  400. function ragdoll(model)
  401. local char = model
  402. torso = char.HumanoidRootPart
  403. torso2 = char.Torso
  404. LW.Parent = nil
  405. RW.Parent = nil
  406. LH.Parent = nil
  407. RH.Parent = nil
  408. if hum ~= nil then
  409. hum.PlatformStand = true
  410. end
  411.  
  412. local Head = char:FindFirstChild("Head")
  413. if Head then
  414. local Neck = Instance.new("Weld")
  415. Neck.Name = "Neck"
  416. Neck.Part0 = torso
  417. Neck.Part1 = Head
  418. Neck.C0 = CFrame.new(0, 1.5, 0)
  419. Neck.C1 = CFrame.new()
  420. Neck.Parent = torso
  421. end
  422. local Limb = char:FindFirstChild("Right Arm")
  423. if Limb then
  424.  
  425. Limb.CFrame = torso.CFrame * CFrame.new(1.5, 0, 0)
  426. local Joint = Instance.new("Glue")
  427. Joint.Name = "RightShoulder"
  428. Joint.Part0 = torso
  429. Joint.Part1 = Limb
  430. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  431. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  432. Joint.Parent = torso
  433.  
  434. local B = Instance.new("Part")
  435. B.TopSurface = 0
  436. B.BottomSurface = 0
  437. B.formFactor = "Symmetric"
  438. B.Size = Vector3.new(1, 1, 1)
  439. B.Transparency = 1
  440. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  441. B.Parent = char
  442. local W = Instance.new("Weld")
  443. W.Part0 = Limb
  444. W.Part1 = B
  445. W.C0 = CFrame.new(0, -0.5, 0)
  446. W.Parent = Limb
  447.  
  448. end
  449. local Limb = char:FindFirstChild("Left Arm")
  450. if Limb then
  451.  
  452. Limb.CFrame = torso.CFrame * CFrame.new(-1.5, 0, 0)
  453. local Joint = Instance.new("Glue")
  454. Joint.Name = "LeftShoulder"
  455. Joint.Part0 = torso
  456. Joint.Part1 = Limb
  457. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  458. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  459. Joint.Parent = torso
  460.  
  461. local B = Instance.new("Part")
  462. B.TopSurface = 0
  463. B.BottomSurface = 0
  464. B.formFactor = "Symmetric"
  465. B.Size = Vector3.new(1, 1, 1)
  466. B.Transparency = 1
  467. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  468. B.Parent = char
  469. local W = Instance.new("Weld")
  470. W.Part0 = Limb
  471. W.Part1 = B
  472. W.C0 = CFrame.new(0, -0.5, 0)
  473. W.Parent = Limb
  474.  
  475. end
  476. local Limb = char:FindFirstChild("Right Leg")
  477. if Limb then
  478.  
  479. Limb.CFrame = torso.CFrame * CFrame.new(0.5, -2, 0)
  480. local Joint = Instance.new("Glue")
  481. Joint.Name = "RightHip"
  482. Joint.Part0 = torso
  483. Joint.Part1 = Limb
  484. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  485. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  486. Joint.Parent = torso
  487.  
  488. local B = Instance.new("Part")
  489. B.TopSurface = 0
  490. B.BottomSurface = 0
  491. B.formFactor = "Symmetric"
  492. B.Size = Vector3.new(1, 1, 1)
  493. B.Transparency = 1
  494. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  495. B.Parent = char
  496. local W = Instance.new("Weld")
  497. W.Part0 = Limb
  498. W.Part1 = B
  499. W.C0 = CFrame.new(0, -0.5, 0)
  500. W.Parent = Limb
  501.  
  502. end
  503. local Limb = char:FindFirstChild("Left Leg")
  504. if Limb then
  505.  
  506. Limb.CFrame = torso.CFrame * CFrame.new(-0.5, -2, 0)
  507. local Joint = Instance.new("Glue")
  508. Joint.Name = "LeftHip"
  509. Joint.Part0 = torso
  510. Joint.Part1 = Limb
  511. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  512. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  513. Joint.Parent = torso
  514.  
  515. local B = Instance.new("Part")
  516. B.TopSurface = 0
  517. B.BottomSurface = 0
  518. B.formFactor = "Symmetric"
  519. B.Size = Vector3.new(1, 1, 1)
  520. B.Transparency = 1
  521. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  522. B.Parent = char
  523. local W = Instance.new("Weld")
  524. W.Part0 = Limb
  525. W.Part1 = B
  526. W.C0 = CFrame.new(0, -0.5, 0)
  527. W.Parent = Limb
  528.  
  529. end
  530. --[
  531. local Bar = Instance.new("Part")
  532. Bar.TopSurface = 0
  533. Bar.BottomSurface = 0
  534. Bar.formFactor = "Symmetric"
  535. Bar.Size = Vector3.new(1, 1, 1)
  536. Bar.Transparency = 1
  537. Bar.CFrame = torso.CFrame * CFrame.new(0, 0.5, 0)
  538. Bar.Parent = char
  539. local Weld = Instance.new("Weld")
  540. Weld.Part0 = torso
  541. Weld.Part1 = Bar
  542. Weld.C0 = CFrame.new(0, 0.5, 0)
  543. Weld.Parent = torso
  544. --]]
  545.  
  546. torso.CFrame = CFrame.new(torso.Position)*CFrame.Angles(math.rad(20),math.rad(torso.Orientation.Y),math.rad(torso.Orientation.Z))
  547.  
  548. end
  549.  
  550. --important--
  551.  
  552. function swait(num)
  553. if num == 0 or num == nil then
  554. game:service("RunService").Stepped:wait(0)
  555. else
  556. for i = 0, num do
  557. game:service("RunService").Stepped:wait(0)
  558. end
  559. end
  560. end
  561. function thread(f)
  562. coroutine.resume(coroutine.create(f))
  563. end
  564. function clerp(a, b, t)
  565. local qa = {
  566. QuaternionFromCFrame(a)
  567. }
  568. local qb = {
  569. QuaternionFromCFrame(b)
  570. }
  571. local ax, ay, az = a.x, a.y, a.z
  572. local bx, by, bz = b.x, b.y, b.z
  573. local _t = 1 - t
  574. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  575. end
  576. function QuaternionFromCFrame(cf)
  577. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  578. local trace = m00 + m11 + m22
  579. if trace > 0 then
  580. local s = math.sqrt(1 + trace)
  581. local recip = 0.5 / s
  582. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  583. else
  584. local i = 0
  585. if m00 < m11 then
  586. i = 1
  587. end
  588. if m22 > (i == 0 and m00 or m11) then
  589. i = 2
  590. end
  591. if i == 0 then
  592. local s = math.sqrt(m00 - m11 - m22 + 1)
  593. local recip = 0.5 / s
  594. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  595. elseif i == 1 then
  596. local s = math.sqrt(m11 - m22 - m00 + 1)
  597. local recip = 0.5 / s
  598. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  599. elseif i == 2 then
  600. local s = math.sqrt(m22 - m00 - m11 + 1)
  601. local recip = 0.5 / s
  602. return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  603. end
  604. end
  605. end
  606. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  607. local xs, ys, zs = x + x, y + y, z + z
  608. local wx, wy, wz = w * xs, w * ys, w * zs
  609. local xx = x * xs
  610. local xy = x * ys
  611. local xz = x * zs
  612. local yy = y * ys
  613. local yz = y * zs
  614. local zz = z * zs
  615. 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))
  616. end
  617. function QuaternionSlerp(a, b, t)
  618. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  619. local startInterp, finishInterp
  620. if cosTheta >= 1.0E-4 then
  621. if 1 - cosTheta > 1.0E-4 then
  622. local theta = math.acos(cosTheta)
  623. local invSinTheta = 1 / Sin(theta)
  624. startInterp = Sin((1 - t) * theta) * invSinTheta
  625. finishInterp = Sin(t * theta) * invSinTheta
  626. else
  627. startInterp = 1 - t
  628. finishInterp = t
  629. end
  630. elseif 1 + cosTheta > 1.0E-4 then
  631. local theta = math.acos(-cosTheta)
  632. local invSinTheta = 1 / Sin(theta)
  633. startInterp = Sin((t - 1) * theta) * invSinTheta
  634. finishInterp = Sin(t * theta) * invSinTheta
  635. else
  636. startInterp = t - 1
  637. finishInterp = t
  638. end
  639. 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
  640. end
  641. function rayCast(Position, Direction, Range, Ignore)
  642. return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  643. end
  644. local RbxUtility = LoadLibrary("RbxUtility")
  645. local Create = RbxUtility.Create
  646. local insta = true
  647.  
  648. local equipped = false
  649. local idle = 0
  650. local change = 1
  651. local val = 0
  652. local toim = 0
  653. local idleanim = 0.4
  654. angery = false
  655. VALUE1 = false
  656. hum.Animator.Parent = nil
  657. while true do
  658. swait()
  659. sine = sine + change
  660. local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude
  661. local velderp = root.Velocity.y
  662. hitfloor, posfloor = rayCast(root.Position, CFrame.new(root.Position, root.Position - Vector3.new(0, 1, 0)).lookVector, 4, char)
  663. if equipped == true or equipped == false then
  664. if attack == false then
  665. idle = idle + 1
  666. else
  667. idle = 0
  668. end
  669. if 1 < root.Velocity.y and hitfloor == nil then
  670. Anim = "Jump"
  671. if attack == false then
  672. rootj.C0 = clerp(rootj.C0, RootCF * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,0),0.3)
  673. tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-10), Rad(0), Rad(0)), 0.3)
  674. RW.C0 = clerp(RW.C0, CF(1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(15)),0.3)
  675. LW.C0 = clerp(LW.C0, CF(-1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(-15)),0.3)
  676. LH.C0=clerp(LH.C0, CF(-1,-.4-0.1 * Cos(sine / 20), -.6) * LHCF * angles(Rad(-5), Rad(-0), Rad(20)), 0.15)
  677. RH.C0=clerp(RH.C0, CF(1,-1-0.1 * Cos(sine / 20), -.3) * angles(Rad(0), Rad(90), Rad(0)), .3)
  678. end
  679. elseif -1 > root.Velocity.y and hitfloor == nil then
  680. Anim = "Fall"
  681. if attack == false then
  682. rootj.C0 = clerp(rootj.C0, RootCF * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,0),0.3)
  683. tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(10), Rad(0), Rad(0)), 0.3)
  684. RW.C0 = clerp(RW.C0, CF(1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(90)),0.3)
  685. LW.C0 = clerp(LW.C0, CF(-1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(-90)),0.3)
  686. LH.C0 = clerp(LH.C0, CF(-1,-.4-0.1 * Cos(sine / 20), -.6) * LHCF * angles(Rad(-5), Rad(-0), Rad(20)), 0.15)
  687. RH.C0 = clerp(RH.C0, CF(1,-1-0.1 * Cos(sine / 20), -.3) * angles(Rad(0), Rad(90), Rad(0)), .3)
  688. end
  689. elseif torvel < 1 and hitfloor ~= nil then
  690. Anim = "Idle"
  691. change = .5
  692. if attack == false then
  693. if angery == false then
  694. VALUE1 = false
  695. rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0.5, -0.1 + 0.1 * Cos(sine / 20)) * angles(Rad(-80), Rad(0), Rad(0)), 0.15)
  696. tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-2.5 * Sin(sine / 20)), Rad(0), Rad(0)), 0.3)
  697. RH.C0 = clerp(RH.C0, CF(1, -0.9 - 0.1 * Cos(sine / 20), 0.025 * Cos(sine / 20)) * RHCF * angles(Rad(-4.5), Rad(0), Rad(0)), 0.15)
  698. LH.C0 = clerp(LH.C0, CF(-1, -0.9 - 0.1 * Cos(sine / 20), 0.025 * Cos(sine / 20)) * LHCF * angles(Rad(-6.5), Rad(0), Rad(0)), 0.15)
  699. RW.C0 = clerp(RW.C0, CF(1.5, 0.5 + 0.05 * Sin(sine / 20), 0.025 * Cos(sine / 20)) * angles(Rad(180), Rad(0), Rad(5), 0.1))
  700. LW.C0 = clerp(LW.C0, CF(-1.5, 0.5 + 0.05 * Sin(sine / 20), 0.025 * Cos(sine / 20)) * angles(Rad(180), Rad(0), Rad(5), 0.1))
  701. if VALUE1 == false and math.random(1,200) == 1 then
  702. coroutine.resume(coroutine.create(function()
  703. VALUE1 = true
  704. for i = 1, 25 do
  705. swait()
  706. tors.Neck.C0=clerp(tors.Neck.C0,necko*angles(math.rad(-25),math.rad((15+math.random(-15,15)/15)),math.rad(30)),.3)
  707. end
  708. VALUE1 = false
  709.  
  710. end))
  711. end
  712. elseif angery == true then
  713. rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.1 + 0.1) * angles(Rad(0), Rad(0), Rad(0)), 0.15)
  714. tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-0), Rad(0), Rad(0)), 0.3)
  715. RH.C0 = clerp(RH.C0, CF(1, -0.9 - 0.1 , 0.025 * Cos(sine / 20)) * RHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15)
  716. LH.C0 = clerp(LH.C0, CF(-1, -0.9 - 0.1 , 0.025 * Cos(sine / 20)) * LHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15)
  717. RW.C0 = clerp(RW.C0, CF(1.5, 0.5 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(90)), 0.1)
  718. LW.C0 = clerp(LW.C0, CF(-1.5, 0.5 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(-90)), 0.1)
  719. if VALUE1 == false and math.random(1,200) == 1 then
  720. coroutine.resume(coroutine.create(function()
  721. VALUE1 = true
  722. for i = 1, 25 do
  723. swait()
  724. FT.Parent = tors
  725. RA.Parent = ra
  726. LA.Parent = la
  727. RL.Parent = rl
  728. LL.Parent = ll
  729. for _,v in next, char:GetDescendants() do
  730. if(v:IsA'DataModelMesh')then
  731. v.Offset = Vector3.new(math.random(-200,200)/100,math.random(-200,200)/100,math.random(-200,200)/100)
  732. end
  733. end
  734. tors.Neck.C0=clerp(tors.Neck.C0,necko*angles(math.rad(-25),math.rad((15+math.random(-15,15)/15)),math.rad(0)),.3)
  735. end
  736. VALUE1 = false
  737. FT.Parent = nil
  738. RA.Parent = nil
  739. LA.Parent = nil
  740. RL.Parent = nil
  741. LL.Parent = nil
  742. for _,v in next, char:GetDescendants() do
  743. if(v:IsA'DataModelMesh')then
  744. v.Offset = Vector3.new(0,0,0)
  745. end
  746. end
  747.  
  748. end))
  749. end
  750. end
  751. end
  752. elseif tors.Velocity.magnitude < 50 and hitfloor ~= nil then
  753. Anim = "Walk"
  754. change = 1
  755. if attack == false then
  756. rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.1 + 0.1) * angles(Rad(0), Rad(0), Rad(0)), 0.15)
  757. tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-0), Rad(0), Rad(0)), 0.3)
  758. RH.C0 = clerp(RH.C0, CF(1, -0.9 - 0.1 , 0.025 * Cos(sine / 20)) * RHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15)
  759. LH.C0 = clerp(LH.C0, CF(-1, -0.9 - 0.1 , 0.025 * Cos(sine / 20)) * LHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15)
  760. RW.C0 = clerp(RW.C0, CF(1.5, 0.5 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(90)), 0.1)
  761. LW.C0 = clerp(LW.C0, CF(-1.5, 0.5 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(-90)), 0.1)
  762. end
  763. end
  764. end
  765. if 0 < #Effects then
  766. for e = 1, #Effects do
  767. if Effects[e] ~= nil then
  768. local Thing = Effects[e]
  769. if Thing ~= nil then
  770. local Part = Thing[1]
  771. local Mode = Thing[2]
  772. local Delay = Thing[3]
  773. local IncX = Thing[4]
  774. local IncY = Thing[5]
  775. local IncZ = Thing[6]
  776. if 1 >= Thing[1].Transparency then
  777. if Thing[2] == "Block1" then
  778. Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  779. local Mesh = Thing[1].Mesh
  780. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  781. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  782. elseif Thing[2] == "Block2" then
  783. Thing[1].CFrame = Thing[1].CFrame + Vector3.new(0, 0, 0)
  784. local Mesh = Thing[7]
  785. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  786. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  787. elseif Thing[2] == "Block3" then
  788. Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) + Vector3.new(0, 0.15, 0)
  789. local Mesh = Thing[7]
  790. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  791. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  792. elseif Thing[2] == "Cylinder" then
  793. local Mesh = Thing[1].Mesh
  794. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  795. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  796. elseif Thing[2] == "Blood" then
  797. local Mesh = Thing[7]
  798. Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, 0.5, 0)
  799. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  800. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  801. elseif Thing[2] == "Elec" then
  802. local Mesh = Thing[1].Mesh
  803. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9])
  804. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  805. elseif Thing[2] == "Disappear" then
  806. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  807. elseif Thing[2] == "Shatter" then
  808. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  809. Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0)
  810. Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
  811. Thing[6] = Thing[6] + Thing[5]
  812. end
  813. else
  814. Part.Parent = nil
  815. table.remove(Effects, e)
  816. end
  817. end
  818. end
  819. end
  820. end
  821. end
  822. -------------------------------------------------------
  823. --End Animations And Script--
  824. -------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement