Advertisement
SCRIPTCUSTOMIZER

Test 01

Nov 26th, 2023
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1.  
  2. -- RECLOVR NON-FE
  3.  
  4. local Player = game.Players.LocalPlayer
  5. local Character = Player.Character
  6.  
  7. local R1down = false
  8. local VRService = game:GetService("VRService")
  9. local UserInputService = game:GetService("UserInputService")
  10. local StarterGui = game:GetService("StarterGui")
  11. local Off = CFrame.Angles(0, 0, 0)
  12.  
  13. local Camera = workspace.CurrentCamera
  14. local RunService = game:GetService("RunService")
  15.  
  16. local function CreatePart(Size, Name)
  17. local Part = Instance.new("Part", Camera)
  18. Part.Name = Name
  19. Part.Size = Size
  20. Part.CanCollide = false Part.CanTouch = false Part.CanQuery = false
  21. Part.Anchored = true
  22. return Part
  23. end
  24.  
  25. local LeftHand, RightHand, Head = CreatePart(Vector3.new(1,1,2), "LH"), CreatePart(Vector3.new(1,1,2), "RH"), CreatePart(Vector3.new(1.5,1.5,1.5), "HD")
  26.  
  27. RunService.RenderStepped:Connect(function()
  28. StarterGui:SetCore("VRLaserPointerMode", 0) -- Fixes roblox's weird VR Camera bug
  29. StarterGui:SetCore("VREnableControllerModels", false) -- Fixes roblox's weird VR Camera bug
  30. Camera.HeadScale = 3 -- Fixes roblox's weird VR Camera bug
  31.  
  32. local LeftCF, RightCF, HeadCF = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand), VRService:GetUserCFrame(Enum.UserCFrame.RightHand), VRService:GetUserCFrame(Enum.UserCFrame.Head)
  33. Camera.CameraType = Enum.CameraType.Scriptable
  34.  
  35. LeftHand.CFrame = Camera.CFrame * (CFrame.new(LeftCF.p*(Camera.HeadScale-1))*LeftCF)
  36. RightHand.CFrame = Camera.CFrame * (CFrame.new(RightCF.p*(Camera.HeadScale-1))*RightCF) * Off
  37. Head.CFrame = Camera.CFrame * (CFrame.new(HeadCF.p*(Camera.HeadScale-1))*HeadCF)
  38.  
  39. if R1down then
  40. Camera.CFrame = Camera.CFrame:Lerp(Camera.CoordinateFrame + (RightHand.CFrame*CFrame.Angles(-math.rad(0),-math.rad(0),math.rad(180-0))).LookVector * Camera.HeadScale, Camera.HeadScale / 2)
  41. end
  42. end)
  43.  
  44. local Handle = Instance.new("Part",workspace)
  45. Handle.Size = Vector3.new(1, 1, 2)
  46. local msh = Instance.new("SpecialMesh",Handle)
  47. msh.MeshType = Enum.MeshType.FileMesh
  48. msh.MeshId = "rbxassetid://6774735978"
  49. msh.TextureId = "rbxassetid://6774736019"
  50. msh.Offset = Vector3.new(0, 0.65, -2)
  51.  
  52. local HandleW = Instance.new("Weld",Handle)
  53. HandleW.Part0=Handle
  54. HandleW.Part1=RightHand
  55.  
  56. -- Flinging
  57.  
  58. local Pos = CFrame.new(0, 0, 0)
  59. local Fling = false
  60. local Root = Character:FindFirstChildOfClass("Humanoid").RootPart
  61.  
  62.  
  63. local function OnButton1Down()
  64. local RC = workspace:Raycast(Handle.Position, Handle.CFrame.LookVector * 100, RaycastParams.new())
  65. if RC then
  66. local c = Pos
  67. Fling = true
  68. for _, x in pairs(workspace:GetDescendants()) do
  69. if x:IsA("Humanoid") then
  70. if x.RootPart then
  71. if (x.RootPart.Position - RC.Position).Magnitude < 15 then
  72. Pos = x.RootPart.Position
  73. end
  74. end
  75. end
  76. end
  77. if Pos == c then
  78. Pos = RC.Position
  79. end
  80. task.spawn(function()
  81. for i=1, 6 do
  82. task.wait()
  83. Off=Off:Lerp(CFrame.Angles(math.rad(30), math.rad(0), math.rad(0)), 0.65)
  84. end
  85. for i=1, 6 do
  86. task.wait()
  87. Off=Off:Lerp(CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), 0.35)
  88. end
  89. end)
  90. task.wait(0.5)
  91. Fling=false
  92. end
  93. end
  94.  
  95. Player:GetMouse().Button1Down:Connect(OnButton1Down)
  96.  
  97. for _,x in pairs(Character:GetDescendants())do
  98. if x:IsA("BasePart") then
  99. x.Transparency=1
  100. end
  101. end
  102.  
  103. Root.Transparency=0
  104. local h = Instance.new("Highlight",Root)
  105. RunService.Heartbeat:Connect(function()
  106. if Character then
  107. if not Fling then
  108. Root.CFrame = Head.CFrame * CFrame.new(0, -2, 0)
  109. Root.RotVelocity = Vector3.zero
  110. Root.Velocity=Vector3.zero
  111. else
  112. Root.CFrame = CFrame.new(Pos)
  113. Root.RotVelocity = Vector3.new(1000,1000,1000)
  114. end
  115. end
  116. end)
  117.  
  118. -- Movement
  119.  
  120.  
  121. UserInputService.InputChanged:connect(function(key)
  122. if key.KeyCode == Enum.KeyCode.ButtonR1 then
  123. if key.Position.Z > 0.9 then
  124. R1down = true
  125. else
  126. R1down = false
  127. end
  128. end
  129. end)
  130.  
  131. UserInputService.InputBegan:connect(function(key)
  132. if key.KeyCode == Enum.KeyCode.ButtonR1 then
  133. R1down = true
  134. end
  135. end)
  136.  
  137. UserInputService.InputEnded:connect(function(key)
  138. if key.KeyCode == Enum.KeyCode.ButtonR1 then
  139. R1down = false
  140. end
  141. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement