Advertisement
HenloMyDude

(FE) testing animations

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