Advertisement
XxGuestUltimatexX

FE Vr Script (Sorry I not found credits)

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