SCRIPTCUSTOMIZER

Test 02

Nov 26th, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.31 KB | None | 0 0
  1.  
  2. local Headscale = 3.2 --The cameras headscale (3.2) is recommended
  3. local HeadHat = "MediHood" --The hat assummed to be worn for the head
  4.  
  5. local VRFlyspeed = 1 -- (1 - 0.1) 1 = Fast and rigid 0.1 = Slow and smooth
  6. local VRControllersShown = false --true = Roblox Default VR Controllers, false = No Controllers
  7. local VRBottomBar = true --false = Bottom Bar Destroyed (More Immersion), true Bottom bar doesn't change
  8.  
  9. local AntiBreak = true --Uses my Experimental Netbypass (Very Stable), False Uses netless v4 (Less Stable)
  10. local AntiLag = false --Use only on Low-end PCS for best experience
  11.  
  12. local LeftCFrameRotoOffset = Vector3.new(140,-120,185) -- Vector3.new(130,-90,180)
  13. local RightCFrameRotoOffset = Vector3.new(130,120,-185)
  14.  
  15.  
  16.  
  17. --// Now the script
  18.  
  19. local VRService = game:GetService("VRService")
  20. local Player = game:GetService("Players").LocalPlayer
  21. local Character = Player.Character
  22. local RunService = game:GetService("RunService")
  23. local UserInputService = game:GetService("UserInputService")
  24. local Camera = game:GetService("Workspace").CurrentCamera
  25. local hb={}
  26.  
  27. local cf=CFrame.new
  28. local v3=Vector3.new
  29. local sin=math.sin
  30. local angles=CFrame.Angles
  31. local rad=math.rad
  32. local cl=os.clock
  33. local rand=math.random
  34.  
  35.  
  36. local function CreatePart(Size,Name)
  37. local Part = Instance.new("Part",Camera)
  38. Part.Size = Size
  39. Part.Name = Name
  40. Part.Transparency = 1
  41. Part.CanCollide = false
  42. Part.Anchored = true
  43. Part.CFrame = Character["Head"].CFrame
  44. return Part
  45. end
  46. local MoveLeftHand = CreatePart(Vector3.new(1,1,1),"LHand")
  47. local MoveRightHand = CreatePart(Vector3.new(1,1,1),"RHand")
  48. local MoveHead = CreatePart(Vector3.new(0.01,0.01,0.01),"Head")
  49.  
  50. local function Align(Part0,Part1,CFrameOffset)
  51. local AttachmentA = Instance.new("Attachment",Part0)
  52. local AttachmentB = Instance.new("Attachment",Part1)
  53. local AlignPosition = Instance.new("AlignPosition",Part0)
  54. local AlignOrientation = Instance.new("AlignOrientation",Part0)
  55. AlignPosition.Responsiveness = 200
  56. AlignPosition.MaxForce = math.huge
  57. AlignPosition.MaxVelocity = math.huge
  58. AlignPosition.RigidityEnabled = false
  59. AlignOrientation.Responsiveness = 200
  60. AlignOrientation.MaxTorque = math.huge
  61. AlignOrientation.MaxAngularVelocity = math.huge
  62. AlignOrientation.RigidityEnabled = false
  63. AlignPosition.Attachment0 = AttachmentA
  64. AlignPosition.Attachment1 = AttachmentB
  65. AlignOrientation.Attachment0 = AttachmentA
  66. AlignOrientation.Attachment1 = AttachmentB
  67. AlignOrientation.Responsiveness=math.huge
  68. AttachmentA.CFrame = AttachmentA.CFrame * CFrameOffset
  69. local rs=nil
  70. rs=RunService.Heartbeat:Connect(function()
  71. if Part0 then
  72. local Handle=Part0
  73. local ReanHandle=Part1
  74. Handle.RotVelocity = v3(sin(cl()*15), sin(cl()*15+1.047), sin(cl()*15+2.094))
  75. Handle.Velocity=v3(0,25.1,0)+ReanHandle.Velocity*v3(10,0,10)
  76. Handle.CanCollide=false
  77. Handle.CFrame = ReanHandle.CFrame + v3(0.0015*sin(cl()*15), 0.0015*sin(cl()*15+1.047), 0.0015*sin(cl()*15+2.094))
  78. end
  79. end)
  80. table.insert(hb,rs)
  81. end
  82.  
  83. for _,Hat in pairs(Character:GetChildren()) do
  84. if Hat:IsA("Accessory") and Hat:FindFirstChild("Handle") then
  85. if Hat.Name == HeadHat then
  86. Align(Hat.Handle,MoveHead,CFrame.new(0,0,0))
  87. Hat.Handle.Transparency = 1
  88. end
  89. if Hat.Name == "Meshes/右手臂Accessory" then
  90. Align(Hat.Handle,MoveRightHand,CFrame.new(0,0,0),CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  91. end
  92. if Hat.Name == "Meshes/左手臂Accessory" then
  93. Align(Hat.Handle,MoveLeftHand,CFrame.new(0,0,0),CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  94. end
  95. end
  96. end
  97. Player.CharacterAdded:Connect(function(M)
  98. for _, x in pairs(hb) do
  99. if x then
  100. x:Disconnect()
  101. x=nil
  102. end
  103. end
  104. M:WaitForChild("Humanoid")
  105. task.wait(0.25)
  106. for _,Hat in pairs(M:GetChildren()) do
  107. if Hat:IsA("Accessory") and Hat:FindFirstChild("Handle") then
  108. if Hat.Name == HeadHat then
  109. Align(Hat.Handle,MoveHead,CFrame.new(0,0,0))
  110. Hat.Handle.Transparency = 1
  111. end
  112. if Hat.Name == "Meshes/右手臂Accessory" then
  113.  
  114. Align(Hat.Handle,MoveRightHand,CFrame.new(0,0,0),CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  115. end
  116. if Hat.Name == "Meshes/左手臂Accessory" then
  117. Align(Hat.Handle,MoveLeftHand,CFrame.new(0,0,0),CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)))
  118. end
  119. end
  120. end
  121. M:FindFirstChild("HumanoidRootPart").Velocity=Vector3.new(0, 1000, 0)
  122. M:FindFirstChild("HumanoidRootPart").CFrame=MoveHead.CFrame
  123. for i=1, 100 do
  124. RunService.RenderStepped:Wait()
  125. M:FindFirstChild("HumanoidRootPart").CFrame=MoveHead.CFrame
  126. M:FindFirstChild("HumanoidRootPart").Velocity=Vector3.new(75.01, 45.01, 25.01)
  127. end
  128. task.wait(0.25)
  129. M:BreakJoints()
  130. M:FindFirstChildOfClass("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Dead,true)
  131. end)
  132. local function OnUserCFrame(Type, Value)
  133. if Type == Enum.UserCFrame.RightHand then
  134. MoveRightHand.CFrame = Camera.CoordinateFrame * (CFrame.new(Value.p*(Camera.HeadScale-1))*Value)*CFrame.Angles(math.rad(RightCFrameRotoOffset.X),math.rad(RightCFrameRotoOffset.Y),math.rad(RightCFrameRotoOffset.Z))*CFrame.new(0,-0.5,0)
  135. end
  136. if Type == Enum.UserCFrame.LeftHand then
  137. MoveLeftHand.CFrame = Camera.CoordinateFrame * (CFrame.new(Value.p*(Camera.HeadScale-1))*Value)*CFrame.Angles(math.rad(LeftCFrameRotoOffset.X),math.rad(LeftCFrameRotoOffset.Y),math.rad(LeftCFrameRotoOffset.Z))*CFrame.new(0,-0.5,0)
  138. end
  139. if Type == Enum.UserCFrame.Head then
  140. MoveHead.CFrame = Camera.CoordinateFrame * (CFrame.new(Value.p*(Camera.HeadScale-1))*Value)
  141. end
  142. end
  143.  
  144. UserInputService.UserCFrameChanged:Connect(OnUserCFrame)
  145. Camera.HeadScale = Headscale
  146. Camera.CameraType = Enum.CameraType.Scriptable
  147. Camera.CFrame = Character:FindFirstChildOfClass("Humanoid").RootPart.CFrame
  148.  
  149. UserInputService.InputChanged:connect(function(key)
  150. if key.KeyCode == Enum.KeyCode.ButtonR1 then
  151. if key.Position.Z > 0.9 then
  152. R1down = true
  153. else
  154. R1down = false
  155. end
  156. end
  157. end)
  158.  
  159. UserInputService.InputBegan:connect(function(key)
  160. if key.KeyCode == Enum.KeyCode.ButtonR1 then
  161. R1down = true
  162. end
  163. end)
  164.  
  165. UserInputService.InputEnded:connect(function(key)
  166. if key.KeyCode == Enum.KeyCode.ButtonR1 then
  167. R1down = false
  168. end
  169. end)
  170.  
  171. game:GetService("RunService").RenderStepped:connect(function()
  172. Camera.HeadScale=Headscale
  173. if VRControllersShown == false then
  174. game:GetService("StarterGui"):SetCore("VRLaserPointerMode", 0)
  175. game:GetService("StarterGui"):SetCore("VREnableControllerModels", false)
  176. end
  177. if R1down then
  178. Camera.CFrame = Camera.CFrame:Lerp(Camera.CoordinateFrame + (MoveRightHand.CFrame*CFrame.Angles(-math.rad(RightCFrameRotoOffset.X),-math.rad(RightCFrameRotoOffset.Y),math.rad(180-RightCFrameRotoOffset.X))).LookVector * VRFlyspeed, VRFlyspeed)
  179. end
  180. end)
  181. if AntiLag == true then
  182. local lighting = game:GetService("Lighting")
  183. lighting.GlobalShadows = false
  184. lighting.ShadowSoftness = 1
  185. lighting.EnvironmentDiffuseScale = 0
  186. lighting.EnvironmentSpecularScale = 0
  187. settings().Rendering.QualityLevel = Enum.QualityLevel.Level01
  188. settings().Rendering.GraphicsMode = Enum.GraphicsMode.Direct3D11
  189. settings().Rendering.MeshPartDetailLevel = Enum.MeshPartDetailLevel.Level01
  190. end
  191. if VRBottomBar == false then
  192. local panel = Camera:WaitForChild("VRCorePanelParts")
  193. if panel then
  194. panel:WaitForChild("BottomBar_Part"):Destroy()
  195. end
  196. end
  197.  
  198. Character:BreakJoints()
Advertisement
Add Comment
Please, Sign In to add comment