InTesting

New Sit Test

Feb 3rd, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1. local sit = false
  2.  
  3. function Sit2(bool_Sit,Target)
  4.     local torso = Target.Torso
  5.     if bool_Sit==true then
  6.         torso["Right Hip"].C0 = CFrame.new(1,-1,0) * CFrame.fromOrientation(math.rad(0),math.rad(75),math.rad(90))
  7.         torso["Left Hip"].C0 = CFrame.new(-1,-1,0) * CFrame.fromOrientation(math.rad(0),math.rad(-75),math.rad(-90))
  8.         local folder = Instance.new("Folder",Target)
  9.         folder.Name = "SitTest"
  10.         local partr = Instance.new("Part",folder)
  11.         partr.Position = Vector3.new(0,-5,0)
  12.         local at3pr = Instance.new("Attachment",partr)
  13.         local ao = Instance.new("AlignOrientation",torso)
  14.         ao.Attachment0 = torso.NeckAttachment
  15.         ao.Attachment1 = at3pr
  16.         ao.PrimaryAxisOnly = true
  17.         ao.RigidityEnabled = true
  18.         character.Humanoid.PlatformStand = true
  19.     else
  20.         torso["Right Hip"].C0 = CFrame.new(1,-1,0) * CFrame.fromOrientation(math.rad(0),math.rad(90),math.rad(0))
  21.         torso["Left Hip"].C0 = CFrame.new(-1,-1,0) * CFrame.fromOrientation(math.rad(0),math.rad(-90),math.rad(0))
  22.         character.Humanoid.PlatformStand = false
  23.         if character:FindFirstChild("SitTest") then
  24.             character:FindFirstChild("SitTest"):Destroy()
  25.         end
  26.         if character:FindFirstChildWhichIsA("AlignOrientation",true) then
  27.             character:FindFirstChildWhichIsA("AlignOrientation",true):Destroy()
  28.         end
  29.     end
  30. end
Add Comment
Please, Sign In to add comment