terrame341

Untitled

Apr 11th, 2023
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.92 KB | None | 0 0
  1.  
  2. spawn(function()
  3. while true do
  4. settings().Physics.AllowSleep = false
  5. setsimulationradius(math.huge*math.huge,math.huge*math.huge)
  6. game:GetService("RunService").Heartbeat:wait()
  7. end
  8. end)
  9.  
  10. local options = {}
  11.  
  12. -- OPTIONS:
  13.  
  14. options.headscale = 3 -- how big you are in vr, 1 is default, 3 is recommended for max comfort in vr
  15. options.forcebubblechat = true -- decide if to force bubblechat so you can see peoples messages
  16.  
  17. options.headhat = "MediHood" -- name of the accessory which you are using as a head
  18. options.righthandhat = "Pal Hair" -- name of the accessory which you are using as your right hand
  19. options.lefthandhat = "LavanderHair" -- name of the accessory which you are using as your left hand
  20.  
  21. options.righthandrotoffset = Vector3.new(0,0,0)
  22. options.lefthandrotoffset = Vector3.new(0,0,0)
  23.  
  24. --
  25.  
  26. local plr = game:GetService("Players").LocalPlayer
  27. local char = plr.Character
  28. --local backpack = plr.Backpack
  29.  
  30. local VR = game:GetService("VRService")
  31. local input = game:GetService("UserInputService")
  32.  
  33. local cam = workspace.CurrentCamera
  34.  
  35. cam.CameraType = "Scriptable"
  36.  
  37. cam.HeadScale = options.headscale
  38.  
  39. game:GetService("StarterGui"):SetCore("VRLaserPointerMode", 0)
  40. game:GetService("StarterGui"):SetCore("VREnableControllerModels", false)
  41.  
  42.  
  43. local function createpart(size, name)
  44. local Part = Instance.new("Part", char)
  45. Part.CFrame = char.HumanoidRootPart.CFrame
  46. Part.Size = size
  47. Part.Transparency = 1
  48. Part.CanCollide = false
  49. Part.Anchored = true
  50. Part.Name = name
  51. return Part
  52. end
  53.  
  54. local moveHandL = createpart(Vector3.new(1,1,2), "moveRH")
  55. local moveHandR = createpart(Vector3.new(1,1,2), "moveLH")
  56. local moveHead = createpart(Vector3.new(1,1,1), "moveH")
  57.  
  58. local handL
  59. local handR
  60. local head
  61. local R1down = false
  62.  
  63. for i,v in pairs(char.Humanoid:GetAccessories()) do
  64. if v:FindFirstChild("Handle") then
  65. local handle = v.Handle
  66.  
  67. if v.Name == options.righthandhat and not handR then
  68. handle:FindFirstChildOfClass("SpecialMesh"):Destroy()
  69. handR = v
  70. elseif v.Name == options.lefthandhat and not handL then
  71. handle:FindFirstChildOfClass("SpecialMesh"):Destroy()
  72. handL = v
  73. elseif v.Name == options.headhat and not head then
  74. handle.Transparency = 1
  75. head = v
  76. end
  77. end
  78. end
  79.  
  80. char.Humanoid.AnimationPlayed:connect(function(anim)
  81. anim:Stop()
  82. end)
  83.  
  84. for i,v in pairs(char.Humanoid:GetPlayingAnimationTracks()) do
  85. v:AdjustSpeed(0)
  86. end
  87.  
  88. local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  89. torso.Anchored = true
  90. char.HumanoidRootPart.Anchored = true
  91.  
  92. workspace.CurrentCamera.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position)
  93.  
  94. input.UserCFrameChanged:connect(function(part,move)
  95. if part == Enum.UserCFrame.Head then
  96. --move(head,cam.CFrame*move)
  97. moveHead.CFrame = cam.CFrame*(CFrame.new(move.p*(cam.HeadScale-1))*move)
  98. elseif part == Enum.UserCFrame.LeftHand then
  99. --move(handL,cam.CFrame*move)
  100. moveHandL.CFrame = cam.CFrame*(CFrame.new(move.p*(cam.HeadScale-1))*move*CFrame.Angles(math.rad(options.righthandrotoffset.X),math.rad(options.righthandrotoffset.Y),math.rad(options.righthandrotoffset.Z)))
  101. elseif part == Enum.UserCFrame.RightHand then
  102. --move(handR,cam.CFrame*move)
  103. moveHandR.CFrame = cam.CFrame*(CFrame.new(move.p*(cam.HeadScale-1))*move*CFrame.Angles(math.rad(options.righthandrotoffset.X),math.rad(options.righthandrotoffset.Y),math.rad(options.righthandrotoffset.Z)))
  104. end
  105. end)
  106.  
  107. local function Align(Part1,Part0,CFrameOffset) -- i dont know who made this function but 64will64 sent it to me so credit to whoever made it
  108. local AlignPos = Instance.new('AlignPosition', Part1);
  109. AlignPos.Parent.CanCollide = false;
  110. AlignPos.ApplyAtCenterOfMass = true;
  111. AlignPos.MaxForce = 67752;
  112. AlignPos.MaxVelocity = math.huge/9e110;
  113. AlignPos.ReactionForceEnabled = false;
  114. AlignPos.Responsiveness = 200;
  115. AlignPos.RigidityEnabled = false;
  116. local AlignOri = Instance.new('AlignOrientation', Part1);
  117. AlignOri.MaxAngularVelocity = math.huge/9e110;
  118. AlignOri.MaxTorque = 67752;
  119. AlignOri.PrimaryAxisOnly = false;
  120. AlignOri.ReactionTorqueEnabled = false;
  121. AlignOri.Responsiveness = 200;
  122. AlignOri.RigidityEnabled = false;
  123. local AttachmentA=Instance.new('Attachment',Part1);
  124. local AttachmentB=Instance.new('Attachment',Part0);
  125. AttachmentB.CFrame = AttachmentB.CFrame * CFrameOffset
  126. AlignPos.Attachment0 = AttachmentA;
  127. AlignPos.Attachment1 = AttachmentB;
  128. AlignOri.Attachment0 = AttachmentA;
  129. AlignOri.Attachment1 = AttachmentB;
  130. end
  131.  
  132. head.Handle:BreakJoints()
  133. handR.Handle:BreakJoints()
  134. handL.Handle:BreakJoints()
  135.  
  136. Align(head.Handle,moveHead,CFrame.new(0,0,0))
  137. Align(handR.Handle,moveHandR,CFrame.new(0,0,0))
  138. Align(handL.Handle,moveHandL,CFrame.new(0,0,0))
  139.  
  140. input.InputChanged:connect(function(key)
  141. if key.KeyCode == Enum.KeyCode.ButtonR1 then
  142. if key.Position.Z > 0.9 then
  143. R1down = true
  144. else
  145. R1down = false
  146. end
  147. end
  148. end)
  149.  
  150. input.InputBegan:connect(function(key)
  151. if key.KeyCode == Enum.KeyCode.ButtonR1 then
  152. R1down = true
  153. end
  154. end)
  155.  
  156. input.InputEnded:connect(function(key)
  157. if key.KeyCode == Enum.KeyCode.ButtonR1 then
  158. R1down = false
  159. end
  160. end)
  161.  
  162. game:GetService("RunService").RenderStepped:connect(function()
  163. if R1down then
  164. cam.CFrame = cam.CFrame:Lerp(cam.CoordinateFrame + (moveHandR.CFrame*CFrame.Angles(-math.rad(options.righthandrotoffset.X),-math.rad(options.righthandrotoffset.Y),math.rad(180-options.righthandrotoffset.X))).LookVector * cam.HeadScale/2, 0.5)
  165. end
  166. end)
  167.  
  168. local function bubble(plr,msg)
  169. game:GetService("Chat"):Chat(plr.Character.Head,msg,Enum.ChatColor.White)
  170. end
  171.  
  172. if options.forcebubblechat == true then
  173. game.Players.PlayerAdded:connect(function(plr)
  174. plr.Chatted:connect(function(msg)
  175. game:GetService("Chat"):Chat(plr.Character.Head,msg,Enum.ChatColor.White)
  176. end)
  177. end)
  178.  
  179. for i,v in pairs(game.Players:GetPlayers()) do
  180. v.Chatted:connect(function(msg)
  181. game:GetService("Chat"):Chat(v.Character.Head,msg,Enum.ChatColor.White)
  182. end)
  183. end
  184. end
Add Comment
Please, Sign In to add comment