Advertisement
Liu-2

T-Pose - [ Roblox ]

Jun 20th, 2019
1,798
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.75 KB | None | 0 0
  1. --- [[ E ]] ---
  2. -- by fo43123
  3.  
  4. local me = game.Players.LocalPlayer
  5. local char = me.Character
  6. local ts = char['Torso']
  7. local hd = char['Head']
  8. local hum = char['Humanoid']
  9. local root = char['HumanoidRootPart']
  10. local rj = root['RootJoint']
  11. local nk = ts['Neck']
  12. local rs = ts['Right Shoulder']
  13. local ls = ts['Left Shoulder']
  14. local rh = ts['Right Hip']
  15. local lh = ts['Left Hip']
  16. local anim = char:FindFirstChild('Animate')
  17. local v3 = Vector3.new
  18. local cc = workspace.CurrentCamera
  19. local cfn = CFrame.new
  20. local cfa = CFrame.Angles
  21. local rand = math.random
  22. local rad = math.rad
  23. local cos = math.cos
  24. local sin = math.sin
  25. local sine = 0
  26. local change = 1
  27. local cooldown = false
  28. local attack = false
  29. local cananim = true
  30. local rj0 = rj.C0
  31. local nk0 = nk.C0
  32. local rs0 = rs.C0
  33. local ls0 = ls.C0
  34. local rh0 = rh.C0
  35. local lh0 = lh.C0
  36. local mouse = me:GetMouse()
  37. local sicko = Instance.new('Sound', hd)
  38. hum.Health = 'inf'
  39. hum.MaxHealth = 'inf'
  40. sicko.SoundId = 'rbxassetid://1737012738' --689628356
  41. sicko.Volume = 5
  42. sicko.Looped = true
  43. sicko:Play()
  44. print([[
  45.     -- Moves --
  46.     T - (Toggle) tpose on haters
  47. ]])
  48. if anim then
  49.     anim.Parent = nil
  50.     for i,v in pairs(hum:GetPlayingAnimationTracks()) do
  51.         v:Stop()
  52.     end
  53. end
  54.  
  55.  
  56. ArtificialHB = Instance.new('BindableEvent', script)
  57. ArtificialHB.Name = 'Heartbeat'
  58. script:WaitForChild('Heartbeat')
  59.  
  60. frame = 1 / 60
  61. tf = 0
  62. allowframeloss = false
  63. tossremainder = false
  64.  
  65. lastframe = tick()
  66. script.Heartbeat:Fire()
  67.  
  68. game:GetService('RunService').Heartbeat:connect(function(s, p)
  69.     tf = tf + s
  70.     if tf >= frame then
  71.         if allowframeloss then
  72.             script.Heartbeat:Fire()
  73.             lastframe = tick()
  74.         else
  75.             for i = 1, math.floor(tf / frame) do
  76.                 script.Heartbeat:Fire()
  77.             end
  78.             lastframe = tick()
  79.         end
  80.         if tossremainder then
  81.             tf = 0
  82.         else
  83.             tf = tf - frame * math.floor(tf / frame)
  84.         end
  85.     end
  86. end)
  87.  
  88. function swait(t)
  89.     if t == 0 or t == nil then
  90.         script.Heartbeat.Event:Wait()
  91.     else
  92.         for i = 0, t do
  93.             script.Heartbeat.Event:Wait()
  94.         end
  95.     end
  96. end
  97.  
  98. function clerp(a, b, t)
  99.     return a:lerp(b, t)
  100. end
  101.  
  102. function player(var)
  103.     if var.Parent then
  104.         if var.Parent:FindFirstChildOfClass('Humanoid') then
  105.             if var.Parent:FindFirstChild('Torso') and var.Parent:FindFirstChild('Head') then
  106.                 if var.Parent:IsA('Model') then
  107.                     if var.Parent.Name ~= me.Name then
  108.                         return var.Parent
  109.                     end
  110.                 end
  111.             end
  112.         end
  113.     end
  114. end
  115.  
  116. function tpose()
  117.     cooldown = true
  118.     cananim = false
  119.     local awoke = Instance.new('Sound', hd)
  120.     local range = Instance.new('Part', ts)
  121.     range.Shape = 'Ball'
  122.     range.Material = 'SmoothPlastic'
  123.     range.Anchored = false
  124.     range.CanCollide = false
  125.     range.Size = v3(50, 50, 50)
  126.     range.Transparency = 1
  127.     range.Name = 'Range'
  128.     awoke.Volume = 3
  129.     awoke.Looped = true
  130.     awoke.SoundId = 'rbxassetid://1146827394'
  131.     awoke:Play()
  132.     sicko:Pause()
  133.     range.Touched:connect(function(hit)
  134.         if cooldown then
  135.             if player(hit) then
  136.                 if attack == false then
  137.                     attack = true
  138.                     local bv = Instance.new('BodyVelocity', hit)
  139.                     local effect = Instance.new('Part', ts)
  140.                     local yeet = Instance.new('Sound', hit)
  141.                     effect.Material = 'Neon'
  142.                     effect.Anchored = true
  143.                     effect.CanCollide = false
  144.                     effect.Size = v3(0, 0, 0)
  145.                     effect.Shape = 'Ball'
  146.                     yeet.SoundId = 'rbxassetid://525743689'
  147.                     yeet.Volume = 'inf'
  148.                     yeet:Play()
  149.                     game.Debris:AddItem(yeet, yeet.PlaybackSpeed)
  150.                     coroutine.wrap(function()
  151.                         for i = 1, 20 do
  152.                             effect.CFrame = hit.CFrame
  153.                             hum.CameraOffset = hum.CameraOffset:lerp(v3(rand(-1, 1), rand(-1, 1), rand(-1, 1)), 1)
  154.                             effect.Color = Color3.fromRGB(rand(0, 255), rand(0, 255), rand(0, 255))
  155.                             effect.Transparency = effect.Transparency + 0.1
  156.                             effect.Size = effect.Size:lerp(v3(20, 20, 20), 0.25)
  157.                             if effect.Transparency >= 1 then
  158.                                 effect:Destroy()
  159.                             end
  160.                             swait()
  161.                         end
  162.                         hum.CameraOffset = v3(0, 0, 0)
  163.                     end)()
  164.                     bv.MaxForce = v3(math.huge, math.huge, math.huge)
  165.                     bv.Velocity = cfn(range.Position, hit.Position).lookVector*100
  166.                     game.Debris:AddItem(bv, 0.1)
  167.                     wait()
  168.                     player(hit):BreakJoints()
  169.                     --wait(0.1)
  170.                     attack = false
  171.                 end
  172.             end
  173.         end
  174.     end)
  175.     repeat
  176.         change = 1
  177.         range.CFrame = ts.CFrame
  178.         nk.C0 = nk.C0:lerp(nk0 * cfa(rad(0), rad(0), rad(0)) * cfn(0, 0, 0), 0.1)
  179.         rs.C0 = rs.C0:lerp(rs0 * cfa(rad(-90), rad(0), rad(0)) * cfn(0, -0.5, -0.5), 0.1)
  180.         ls.C0 = ls.C0:lerp(ls0 * cfa(rad(-90), rad(0), rad(0)) * cfn(0, -0.5, -0.5), 0.1)
  181.         if (root.Velocity * v3(1, 0, 1)).magnitude < 2 then
  182.             rj.C0 = rj.C0:lerp(rj0 * cfa(rad(0), rad(0), rad(0)) * cfn(0, 0, 0), 0.1)
  183.             rh.C0 = rh.C0:lerp(rh0 * cfa(rad(0), rad(0), rad(0)) * cfn(0, 0, 0), 0.1)
  184.             lh.C0 = lh.C0:lerp(lh0 * cfa(rad(0), rad(0), rad(0)) * cfn(0, 0, 0), 0.1)
  185.         elseif (root.Velocity * v3(1, 0, 1)).magnitude < 20 then
  186.             hum.CameraOffset = hum.CameraOffset:lerp(v3(0, 1 * sin(sine/3), 0), 0.1)
  187.             rj.C0 = rj.C0:lerp(rj0 * cfa(rad(20 + sin(sine/6)) * sin(sine/3), rad(0) - root.RotVelocity.Y/35, rad(0)), 0.1)
  188.             rh.C0 = rh.C0:lerp(rh0 * cfa(rad(0) - root.RotVelocity.Y/30, rad(0), rad(-120 * sin(sine/6))), 0.1)
  189.             lh.C0 = lh.C0:lerp(lh0 * cfa(rad(0) - -root.RotVelocity.Y/30, rad(0), rad(-120 * sin(sine/6))), 0.1)
  190.         end
  191.         swait()
  192.     until cooldown == false
  193.     awoke:Destroy()
  194.     range:Destroy()
  195.     sicko:Resume()
  196.     cananim = true
  197. end
  198.  
  199. mouse.KeyDown:connect(function(k)
  200.     if k == 't' and cooldown == false then
  201.         cooldown = true
  202.         tpose()
  203.     elseif k == 't' and cooldown then
  204.         cooldown = false
  205.     end
  206. end)
  207.  
  208. me.Chatted:connect(function(msg)
  209.     if msg:sub(1,2) == 'p/' then
  210.         sicko.SoundId = 'rbxassetid://'..msg:sub(3)
  211.         sicko:Play()
  212.     end
  213. end)
  214.  
  215. hum.HealthChanged:connect(function()
  216.     hum.Health = 'inf'
  217.     hum.MaxHealth = 'inf'
  218. end)
  219.  
  220. while true do
  221.     sine = sine + change
  222.     --sicko.PlaybackSpeed = rand(10, 14)/10
  223.     cc.FieldOfView = 70 + sicko.PlaybackLoudness/100
  224.     hum.CameraOffset = hum.CameraOffset:lerp(v3(rand(-1, 1), rand(-1, 1), rand(-1, 1)), sicko.PlaybackLoudness/5000)
  225.     local tsvel = (root.Velocity * v3(1, 0, 1)).magnitude
  226.     if tsvel < 2 and cananim then
  227.         change = 1
  228.         hum.CameraOffset = hum.CameraOffset:lerp(v3(0, 0, 0), 0.1)
  229.         rj.C0 = rj.C0:lerp(rj0 * cfa(rad(0 - sicko.PlaybackLoudness/10), rad(0), rad(0)) * cfn(0, 0, 0 - sicko.PlaybackLoudness/1000), 0.1)
  230.         nk.C0 = nk.C0:lerp(nk0 * cfa(rad(0 - sicko.PlaybackLoudness/50), rad(0), rad(0)) * cfn(0, 0, 0), 0.1)
  231.         rs.C0 = rs.C0:lerp(rs0 * cfa(rad(-5 - sicko.PlaybackLoudness/50), rad(0 - sicko.PlaybackLoudness/50), rad(0 + sicko.PlaybackLoudness/10)) * cfn(0, 0, 0), 0.1)
  232.         ls.C0 = ls.C0:lerp(ls0 * cfa(rad(-5 - sicko.PlaybackLoudness/50), rad(0 + sicko.PlaybackLoudness/50), rad(0 - sicko.PlaybackLoudness/10)) * cfn(0, 0, 0), 0.1)
  233.         rh.C0 = rh.C0:lerp(rh0 * cfa(rad(-5), rad(0), rad(0 - sicko.PlaybackLoudness/10)) * cfn(0, 0, 0), 0.1)
  234.         lh.C0 = lh.C0:lerp(lh0 * cfa(rad(-5), rad(0), rad(0 + sicko.PlaybackLoudness/10)) * cfn(0, 0, 0), 0.1)
  235.     elseif tsvel < 20 and cananim then
  236.         change = 1
  237.         hum.CameraOffset = hum.CameraOffset:lerp(v3(0, 1 * sin(sine/3), 0), 0.1)
  238.         rj.C0 = rj.C0:lerp(rj0 * cfa(rad(20 + sin(sine/6)) * sin(sine/3), rad(0) - root.RotVelocity.Y/30, rad(10) * sin(sine/3)), 0.1)
  239.         nk.C0 = nk.C0:lerp(nk0 * cfa(rad(10) * -sin(sine/3), rad(0) - root.RotVelocity.Y/60, rad(0) - root.RotVelocity.Y/50), 0.1)
  240.         rs.C0 = rs.C0:lerp(rs0 * cfa(rad(0), rad(0) - root.RotVelocity.Y/50 - -0.1 + sin(sine/6)/12, rad(120 * sin(sine/6))) * cfn(0, 0, .050), 0.1)
  241.         ls.C0 = ls.C0:lerp(ls0 * cfa(rad(0), rad(0) - root.RotVelocity.Y/50 - 0.1 + sin(sine/6)/12, rad(120 * sin(sine/6))) * cfn(0, 0, .050), 0.1)
  242.         rh.C0 = rh.C0:lerp(rh0 * cfa(rad(0) - root.RotVelocity.Y/30, rad(0), rad(-120 * sin(sine/6))), 0.1)
  243.         lh.C0 = lh.C0:lerp(lh0 * cfa(rad(0) - -root.RotVelocity.Y/30, rad(0), rad(-120 * sin(sine/6))), 0.1)
  244.     end
  245.     swait()
  246. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement