Advertisement
InTesting

TPose (T)

Jul 28th, 2019
830
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.18 KB | None | 0 0
  1. print([[
  2.     T = Do / undo a tpose
  3.    
  4.     I made this just to test my Motor/Weld Function and FE Function.
  5.      - -._-. / Soft
  6.  
  7.     Ps press T two times tho on the first one
  8.  
  9. https://pastebin.com/raw/76n6snGb
  10.     ]])
  11.  
  12. local function Get_New_Motor(rig,Instance_variant_1,type_)
  13.     --[[
  14.         // Description \\
  15.         Returns new Motor6D based of Variant_1. Properites .C0 and .C1 will be defaulted to
  16.         the default idle. The Main Purpose is to kill the animator so that the default walking
  17.         animation does not interfere the CFrame animations. Note that the neck will kill
  18.         the character and RootJoint will be excused.
  19.        
  20.         Parameter 1: (Instance) The Model that it will be using. Note that it has a Part named "Torso"
  21.         Parameter 2: (Instance) Motor6D, creates a new Motor6D, most properties will be cloned.
  22.             (Instance) The limb.
  23.         Parameter 3: (boolean) Optional. If true it will return as a Motor6D, else, a weld. Difference
  24.             between the two is that a Motor6D is compatable with the default animations, while a weld doesn't.
  25.            
  26.     --]]
  27.     local Old_M6D
  28.     local function Error_Msg(Res)
  29.         print('Failed to load: '..Res)
  30.     end
  31.     if rig and Instance_variant_1 then
  32.         if typeof(rig)=='Instance'and typeof(Instance_variant_1)=='Instance'then
  33.             local torso = rig:FindFirstChild'Torso'
  34.             if torso then
  35.                 if Instance_variant_1:IsA'Motor6D'then
  36.                     Old_M6D = Instance_variant_1
  37.                 elseif Instance_variant_1:IsA'BasePart'then
  38.                     for _,v in pairs(torso:GetChildren())do
  39.                         if v:IsA'Motor6D'then
  40.                             if v.Part1==Instance_variant_1 then
  41.                                 Old_M6D = v
  42.                                 break
  43.                             end
  44.                         end
  45.                     end
  46.                 end
  47.             else Error_Msg'Can not find torso.'end
  48.         else
  49.             if typeof(rig)~='Instance'then Error_Msg'Argument "rig" is not an Instance.'end
  50.             if typeof(Instance_variant_1)~='Instance'then Error_Msg'Argument Instance_variant_1 is not an Instance.'end end
  51.     else
  52.         if not rig then Error_Msg'Argument 1 is nil.'end
  53.         if not Instance_variant_1 then Error_Msg'Argument 2 is nil.'end
  54.     end
  55.     if Old_M6D then
  56.         local torso = rig.Torso
  57.         local new_M6D
  58.         if not type_ then
  59.             new_M6D = Instance.new('Weld')
  60.         else
  61.             new_M6D = Instance.new("Motor6D")
  62.         end
  63.         new_M6D.Name = Old_M6D.Name
  64.         new_M6D.Part0 = Old_M6D.Part0
  65.         new_M6D.Part1 = Old_M6D.Part1
  66.         local P1n = new_M6D.Part1.Name
  67.         if P1n=='Left Arm'then
  68.             new_M6D.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  69.             new_M6D.C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 0.999999881, 0, -4.37113812e-08)
  70.         elseif P1n=='Right Arm'then
  71.             new_M6D.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  72.             new_M6D.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -0.999999881, 0, -4.37113812e-08)
  73.         elseif P1n=='Left Leg'then
  74.             new_M6D.C0 = CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  75.             new_M6D.C1 = CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 0.999999881, 0, 0.99999994, 1.49011612e-08, -4.37113847e-08)
  76.         elseif P1n=='Right Leg'then
  77.             new_M6D.C0 = CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  78.             new_M6D.C1 = CFrame.new(0.5, 1, 1.1920929e-07, -4.37113883e-08, 0, 1, -2.08616257e-07, 0.999999881, -7.10542736e-15, -0.999999881, -1.49011612e-07, -4.37113847e-08)
  79.         end
  80.         new_M6D.Parent = torso
  81.         Old_M6D:Destroy()
  82.         return new_M6D
  83.     end
  84. end
  85. wait(2)
  86. local pl = game:GetService("Players").SoftlockedUnderZero
  87. local tw = game:GetService("TweenService")
  88. local pc = pl.Character
  89. local LS = Get_New_Motor(pc,pc['Left Arm'])
  90. local RS = Get_New_Motor(pc,pc['Right Arm'])
  91. local is_tposing = false
  92. local not_cooldown = true
  93.  
  94. local A_TweenInfo = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0)
  95. local LS_NewProp = {
  96.     C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08),
  97.     C1 = CFrame.new(0, 1, 0, 1.91068547e-15, -0.99999994, 4.37113883e-08, -4.37113883e-08, -4.37113847e-08, -1, 0.999999821, 0, -4.37113776e-08)
  98.     }
  99. local RS_NewProp = {
  100.     C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08),
  101.     C1 = CFrame.new(0, 1, 0, 1.91068547e-15, 0.99999994, -4.37113883e-08, 4.37113883e-08, -4.37113847e-08, -1, -0.999999821, 0, -4.37113776e-08)
  102. }
  103. local LS_OldProp = {
  104.     C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08),
  105.     C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 0.999999762, 0, -4.37113741e-08)
  106.     }
  107. local RS_OldProp = {
  108.     C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08),
  109.     C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 5.56362636e-08, 1, 2.43193853e-15, 0.99999994, -5.56362707e-08, -0.999999821, 0, -4.37113776e-08)
  110.     }
  111.  
  112. local LS_A = tw:Create(LS,A_TweenInfo,LS_NewProp)
  113. local RS_A = tw:Create(RS,A_TweenInfo,RS_NewProp)
  114.  
  115. local LS_B = tw:Create(LS,A_TweenInfo,LS_OldProp)
  116. local RS_B = tw:Create(RS,A_TweenInfo,RS_OldProp)
  117.  
  118. local function KeyCheck(k)
  119.     if k=='t'and not_cooldown then
  120.         not_cooldown = false
  121.         is_tposing = not is_tposing
  122.         if is_tposing then
  123.             LS_A:Play()
  124.             RS_A:Play()
  125.         else
  126.             LS_B:Play()
  127.             RS_B:Play()
  128.         end
  129.         wait(1)
  130.         not_cooldown = true
  131.     end
  132. end
  133.  
  134. local function Get_Components_Of_Mouse(player)
  135.     --[[
  136.         Just skip to the bottom. Also note: No UserInputService
  137.     --]]
  138.    
  139.     local pchar = player.Character
  140.    
  141.     if pchar then
  142.         local Remote = pchar:FindFirstChild('∞RE_Mouse')
  143.         if not Remote then
  144.             Remote = Instance.new("RemoteEvent",pchar)
  145.             Remote.Name = 'RE_Mouse'
  146.         end
  147.        
  148.        
  149.        
  150.         Remote.Parent = NLS(
  151.             [[
  152. local lp = game:GetService'Players'.LocalPlayer
  153. local mouse = lp:GetMouse()
  154. local runs = game:GetService'RunService'
  155.  
  156. wait(1)
  157.  
  158. local re = script:WaitForChild('RE_Mouse')
  159. if re then
  160.     mouse.KeyDown:Connect(function(k)
  161.         re:FireServer('KeyDown',k)
  162.     end)
  163.     mouse.KeyUp:Connect(function(k)
  164.         re:FireServer('KeyUp',k)
  165.     end)
  166.     mouse.Button1Down:Connect(function()
  167.         re:FireServer('Button1Down')
  168.     end)
  169.     mouse.Button1Up:Connect(function()
  170.         re:FireServer('Button1Up')
  171.     end)
  172.     mouse.Button2Down:Connect(function()
  173.         re:FireServer('Button2Down')
  174.     end)
  175.     mouse.Button2Up:Connect(function()
  176.         re:FireServer('Button2Up')
  177.     end)
  178.    
  179.     runs.Heartbeat:Connect(function()
  180.         local mh = mouse.Hit
  181.         local mt = mouse.Target
  182.         if mh and mt then
  183.             re:FireServer('MouseInfo',mh,mt)
  184.         end
  185.     end)
  186.     re.OnClientEvent:Connect(function(arg1,arg2)
  187.         if arg1=='ChangeMouseIcon'then
  188.             mouse.Icon = arg2
  189.         end
  190.     end)
  191. else
  192.     print('Fat try again.')
  193. end
  194.             ]]
  195.             ,pchar)
  196.         return Remote
  197.     else
  198.         error('Best to actually put your character in the game.')
  199.     end
  200.    
  201.    
  202. end
  203. local RE = Get_Components_Of_Mouse(owner)
  204.  -- Function returns Remote event
  205.  
  206. if RE then
  207.     RE.OnServerEvent:Connect(function(pl,arg1,arg2,arg3)
  208.         if pl==owner then
  209.             if arg1=='KeyDown'then
  210.                 KeyCheck(arg2)
  211.             end
  212.         end
  213.     end)
  214. end
  215.  
  216. --[[
  217.     .OSE() Arguments:
  218.     'KeyDown', <string: Key pressed down>
  219.     'KeyUp', <string: Key pressed up>
  220.     'Button1Down'
  221.     'Button1Up'
  222.     'Button2Down'
  223.     'Button2Up'
  224.     'MouseInfo', <CFrame: Mouse.Hit> , <Instance: Mouse.Target>
  225.    
  226.     :FireClient Goods:
  227.    
  228.     owner,'ChangeMouseIcon', <string: new mouse.Icon asset id>
  229. --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement