VR Script
VR Script
loop
for i,v in next, game:GetService("Players").LocalPlayer.Character:GetDescendants()
do
if v:IsA("BasePart") and v.Name ~="HumanoidRootPart" then
game:GetService("RunService").Heartbeat:connect(function()
v.Velocity = Vector3.new(-30,0,0)
end)
end
end
game:GetService("StarterGui"):SetCore("SendNotification", {
Title = "Notification";
Text = "Netless Ran";
Icon = "rbxthumb://type=Asset&id=5107182114&w=150&h=150"})
Duration = 16;
--|| Settings:
local WearAllAccessories = true -- Use all leftover hats for the head
local AccurateHandPosition = true -- Move your Roblox hands according to your real
hands
local AccessorySettings = {
LeftArm = "";
RightArm = "";
LeftLeg = "";
RightLeg = "";
Torso = "";
Head = true;
BlockArms = true;
BlockLegs = true;
BlockTorso = true;
local FootPlacementSettings = {
RightOffset = Vector3.new(.5, 0, 0),
LeftOffset = Vector3.new(-.5, 0, 0),
}
--|| Script:
Script = function()
--[[
Variables
--]]
Anchor.Anchored = true
Anchor.Transparency = 1
Anchor.CanCollide = false
Anchor.Parent = workspace
if RagdollEnabled then
print("RagdollEnabled, thank you for using CLOVR!")
local NetworkAccess = coroutine.create(function()
settings().Physics.AllowSleep = false
while true do game:GetService("RunService").RenderStepped:Wait()
for _,Players in next, game:GetService("Players"):GetChildren() do
if Players ~= game:GetService("Players").LocalPlayer then
Players.MaximumSimulationRadius = 0.1 Players.SimulationRadius = 0 end end
game:GetService("Players").LocalPlayer.MaximumSimulationRadius =
math.pow(math.huge,math.huge)
game:GetService("Players").LocalPlayer.SimulationRadius = math.huge*math.huge end
end)
coroutine.resume(NetworkAccess)
end
StarterGui:SetCore("VRLaserPointerMode", 3)
--[[
Character Protection
--]]
if HideCharacter then
local Platform = Instance.new("Part")
Platform.Anchored = true
Platform.Size = Vector3.new(100, 5, 100)
Platform.CFrame = CFrame.new(0, 10000, 0)
Platform.Transparency = 1
Platform.Parent = workspace
wait(.5)
end
if AnchorCharacter then
for _, Part in pairs(Character:GetChildren()) do
if Part:IsA("BasePart") then
Part.Anchored = true
end
end
end
end
--[[
Functions
--]]
tween.Completed:Connect(function()
tween:Destroy()
end)
tween:Play()
return tween
end
Orientation.Attachment0 = Attachment1
Orientation.Attachment1 = Attachment0
Orientation.RigidityEnabled = false
Orientation.MaxTorque = 20000
Orientation.Responsiveness = 40
Orientation.Parent = Character.HumanoidRootPart
Position.Attachment0 = Attachment1
Position.Attachment1 = Attachment0
Position.RigidityEnabled = false
Position.MaxForce = 40000
Position.Responsiveness = 40
Position.Parent = Character.HumanoidRootPart
Limb.Massless = false
wait(.2)
RightGrip.Name = "RightGrip"
RightGrip.Part1 = Handle
RightGrip.Part0 = WeldBase
RightGrip.Parent = WeldBase
return RightGrip
end
if DeleteMeshes then
if Accessory.Handle:FindFirstChild("Mesh") then
Accessory.Handle.Mesh:Destroy()
end
end
wait()
UsedAccessories[Accessory] = true
wait()
pcall(function()
Object.Enabled = false
end)
end
end
do
Handle.Transparency = 1
end
--[[
VR Replication Setup
--]]
if RagdollHeadMovement then
for _, Accessory in next, Character:GetChildren() do
if Accessory:IsA("Accessory") and
Accessory:FindFirstChild("Handle") then
local Attachment1 =
Accessory.Handle:FindFirstChildWhichIsA("Attachment")
local Attachment0 =
Character:FindFirstChild(tostring(Attachment1), true)
Orientation.Attachment0 = Attachment1
Orientation.Attachment1 = Attachment0
Orientation.RigidityEnabled = false
Orientation.ReactionTorqueEnabled = true
Orientation.MaxTorque = 20000
Orientation.Responsiveness = 40
Orientation.Parent = Character.Head
Position.Attachment0 = Attachment1
Position.Attachment1 = Attachment0
Position.RigidityEnabled = false
Position.ReactionForceEnabled = true
Position.MaxForce = 40000
Position.Responsiveness = 40
Position.Parent = Character.Head
end
end
end
end
--[[
Movement
--]]
VirtualRig.Name = "VirtualRig"
VirtualRig.RightFoot.BodyPosition.Position = CharacterCFrame.p
VirtualRig.LeftFoot.BodyPosition.Position = CharacterCFrame.p
VirtualRig.Parent = workspace
VirtualRig:SetPrimaryPartCFrame(CharacterCFrame)
VirtualRig.Humanoid.Health = 0
VirtualRig:BreakJoints()
--
VirtualBody.Parent = workspace
VirtualBody.Name = "VirtualBody"
VirtualBody.Humanoid.WalkSpeed = 8
VirtualBody.Humanoid.CameraOffset = Vector3.new(0, StudsOffset, 0)
VirtualBody:SetPrimaryPartCFrame(CharacterCFrame)
VirtualBody.Humanoid.Died:Connect(function()
print("Virtual death")
if AutoRespawn then
Character:BreakJoints()
Camera.CameraSubject = VirtualBody.Humanoid
Character.Humanoid.WalkSpeed = 0
Character.Humanoid.JumpPower = 1
VirtualBody.Humanoid:MoveTo(Point)
end)
Character.Humanoid.Jumping:Connect(function()
VirtualBody.Humanoid.Jump = true
end)
UserInputService.JumpRequest:Connect(function()
VirtualBody.Humanoid.Jump = true
end)
--[[
VR Replication
--]]
if RagdollEnabled then
for _, Part in pairs(Character:GetDescendants()) do
if Part:IsA("BasePart") and Part.Name == "Handle" and
Part.Parent:IsA("Accessory") then
Part.LocalTransparencyModifier = 1
elseif Part:IsA("BasePart") and Part.Transparency < 0.5 and Part.Name
~= "Head" then
Part.LocalTransparencyModifier = 0.5
elseif Part:IsA("BasePart") and Part.Name == "Head" then
Part.LocalTransparencyModifier = 1
end
pcall(function()
Part.Enabled = false
end)
end
end
end
if FloorPart then
return FloorPart, FloorPosition, FloorNormal, (FloorPosition -
Position).Magnitude
else
return nil, Target, Vector3.new(), Distance
end
end
local FootTurn = 1
return
PastThreshold
or
PastTick
end
repeat
RunService.Stepped:Wait()
if
(LowerTorso.Position - RightFooting.Position).Y > 4
or
(LowerTorso.Position - LeftFooting.Position).Y > 4
or
((LowerTorso.Position - RightFooting.Position) * Vector3.new(1,
0, 1)).Magnitude > 4
or
((LowerTorso.Position - LeftFooting.Position) * Vector3.new(1, 0,
1)).Magnitude > 4
then
break
end
until tick() - Yield >= .17
end
Dist = math.clamp(Dist, 0, 5)
local FootTarget =
VirtualRig.LowerTorso.CFrame *
CFrame.new(FootPlacementSettings.RightOffset) -
Vector3.new(0, Dist, 0) +
Character.Humanoid.MoveDirection * (VirtualBody.Humanoid.WalkSpeed / 8)
* 2
FootYield()
local FootTarget =
VirtualRig.LowerTorso.CFrame *
CFrame.new(FootPlacementSettings.LeftOffset) -
Vector3.new(0, Dist, 0) +
Character.Humanoid.MoveDirection * (VirtualBody.Humanoid.WalkSpeed / 8)
* 2
TorsoGrip.C1 = CFrame.new()
TorsoGrip.C0 =
TorsoGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning * CFrame.new(0, -0.25,
0) * AccessorySettings.LimbOffset), Smoothness)
TorsoGrip.Parent = nil
TorsoGrip.Parent = Parent
end
else
local Positioning = VirtualRig.UpperTorso.CFrame
RightLegGrip.C1 = CFrame.new()
RightLegGrip.C0 =
RightLegGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning *
AccessorySettings.LimbOffset), Smoothness)
RightLegGrip.Parent = nil
RightLegGrip.Parent = Parent
end
if LeftHipHandle then
local Positioning =
VirtualRig.LeftLowerLeg.CFrame
: Lerp(VirtualRig.LeftFoot.CFrame, 0.5)
+ Vector3.new(0, 0.5, 0)
LeftLegGrip.C1 = CFrame.new()
LeftLegGrip.C0 =
LeftLegGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(Positioning *
AccessorySettings.LimbOffset), Smoothness)
LeftLegGrip.Parent = nil
LeftLegGrip.Parent = Parent
end
else
do
local Positioning =
VirtualRig.RightLowerLeg.CFrame
: Lerp(VirtualRig.RightFoot.CFrame, 0.5)
* CFrame.Angles(0, math.rad(180), 0)
+ Vector3.new(0, 0.5, 0)
MoveRightLeg(Positioning)
end
do
local Positioning =
VirtualRig.LeftLowerLeg.CFrame
: Lerp(VirtualRig.LeftFoot.CFrame, 0.5)
* CFrame.Angles(0, math.rad(180), 0)
+ Vector3.new(0, 0.5, 0)
MoveLeftLeg(Positioning)
end
end
end
if BasePart then
LocalPositioning = BasePart.CFrame * HeadAtt
end
RightGrip.C1 = HatAtt
RightGrip.C0 =
RightGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(LocalPositioning), Smoothness)
RightGrip.Parent = nil
RightGrip.Parent = Parent
end
if AccurateHandPosition then
HandPosition = HandPosition * CFrame.new(0, 0, 1)
end
HandPosition =
VirtualRig.RightUpperArm.CFrame:Lerp(VirtualRig.RightLowerArm.CFrame, 0.5) *
AccessorySettings.LimbOffset
if Point2 then
VirtualRig.RightUpperArm.Aim.MaxTorque =
Vector3.new(math.huge, math.huge, math.huge)
VirtualRig.RightUpperArm.Aim.CFrame = Camera.CFrame *
AccessorySettings.LimbOffset
elseif VirtualRig.RightUpperArm.Aim.MaxTorque ~=
Vector3.new(0, 0, 0) then
VirtualRig.RightUpperArm.Aim.MaxTorque =
Vector3.new(0, 0, 0)
end
elseif AccurateHandPosition then
LocalPositioning = HandPosition
end
RightHandGrip.C1 = CFrame.new()
RightHandGrip.C0 =
RightHandGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(HandPosition), Smoothness)
RightHandGrip.Parent = nil
RightHandGrip.Parent = Parent
--
EquippedGrip.C1 = EquippedTool.Grip
EquippedGrip.C0 =
EquippedGrip.C0:Lerp(ArmBaseCFrame:ToObjectSpace(LocalPositioning), Smoothness)
EquippedGrip.Parent = nil
EquippedGrip.Parent = Parent
end
if AccurateHandPosition then
HandPosition = HandPosition * CFrame.new(0, 0, 1)
end
LeftHandGrip.C1 = CFrame.new()
LeftHandGrip.C0 =
LeftHandGrip.C0:Lerp(WeldBase.CFrame:ToObjectSpace(HandPosition), Smoothness)
LeftHandGrip.Parent = nil
LeftHandGrip.Parent = Parent
end
end
if RagdollEnabled then
if UserCFrame == Enum.UserCFrame.Head and RagdollHeadMovement then
MoveHead(Positioning)
elseif UserCFrame == Enum.UserCFrame.RightHand then
local Positioning = Positioning
if VRReady then
Positioning = Positioning * AccessorySettings.LimbOffset
end
MoveRightArm(Positioning)
if Point2 then
VirtualRig.RightUpperArm.Aim.MaxTorque =
Vector3.new(math.huge, math.huge, math.huge)
VirtualRig.RightUpperArm.Aim.CFrame = Camera.CFrame *
AccessorySettings.LimbOffset
elseif VirtualRig.RightUpperArm.Aim.MaxTorque ~= Vector3.new(0,
0, 0) then
VirtualRig.RightUpperArm.Aim.MaxTorque = Vector3.new(0, 0,
0)
end
elseif UserCFrame == Enum.UserCFrame.LeftHand then
local Positioning = Positioning
if VRReady then
Positioning = Positioning * AccessorySettings.LimbOffset
end
MoveLeftArm(Positioning)
if Point1 then
VirtualRig.LeftUpperArm.Aim.MaxTorque =
Vector3.new(math.huge, math.huge, math.huge)
VirtualRig.LeftUpperArm.Aim.CFrame = Camera.CFrame *
AccessorySettings.LimbOffset
elseif VirtualRig.LeftUpperArm.Aim.MaxTorque ~= Vector3.new(0, 0,
0) then
VirtualRig.LeftUpperArm.Aim.MaxTorque = Vector3.new(0, 0,
0)
end
end
end
end
if RagdollEnabled then
for _, Part in pairs(Character:GetChildren()) do
if Part:IsA("BasePart") then
Part.CanCollide = false
end
end
end
if NoCollision then
for _, Player in pairs(Players:GetPlayers()) do
if Player ~= Client and Player.Character then
local Descendants = Player.Character:GetDescendants()
for i = 1, #Descendants do
local Part = Descendants[i]
if Part:IsA("BasePart") then
Part.CanCollide = false
Part.Velocity = Vector3.new()
Part.RotVelocity = Vector3.new()
end
end
end
end
end
end)
if RagdollEnabled then
Character.HumanoidRootPart.CFrame = VirtualRig.UpperTorso.CFrame
Character.HumanoidRootPart.Velocity = Vector3.new(0, 0, 0)
end
spawn(function()
while Character and Character.Parent do
FootYield()
UpdateFooting()
end
end)
--[[
Non-VR Support + VR Mechanics
--]]
--[[
Proper Cleanup
--]]
local OnReset
OnReset = Client.CharacterAdded:Connect(function()
OnReset:Disconnect();
CFrameChanged:Disconnect();
OnStepped:Disconnect();
OnRenderStepped:Disconnect();
OnMoving:Disconnect();
OnInput:Disconnect();
OnInputEnded:Disconnect();
VirtualRig:Destroy();
VirtualBody:Destroy();
if RagdollEnabled then
Network:Unclaim();
end
if AutoRun then
delay(2, function()
Script()
end)
end
end)
if ChatEnabled then
spawn(ChatHUDFunc)
end
if ViewportEnabled then
spawn(ViewHUDFunc)
end
do
--[[
Functions
--]]
--[[
Code
--]]
if VRReady then
local Pointer = game:GetObjects("rbxassetid://4476173280")[1]
Pointer.Parent = workspace
Pointer.Beam.Enabled = false
Pointer.Target.ParticleEmitter.Enabled = false
--
local CharacterAdded
CharacterAdded = Client.CharacterAdded:Connect(function()
RenderStepped:Disconnect()
Input:Disconnect()
CharacterAdded:Disconnect()
Pointer:Destroy()
Pointer = nil
end)
else
return
end
end
end;
Permadeath = function()
local ch = game.Players.LocalPlayer.Character
local prt=Instance.new("Model", workspace)
local z1 = Instance.new("Part", prt)
z1.Name="Torso"
z1.CanCollide = false
z1.Anchored = true
local z2 =Instance.new("Part", prt)
z2.Name="Head"
z2.Anchored = true
z2.CanCollide = false
local z3 =Instance.new("Humanoid", prt)
z3.Name="Humanoid"
z1.Position = Vector3.new(0,9999,0)
z2.Position = Vector3.new(0,9991,0)
game.Players.LocalPlayer.Character=prt
wait(5)
warn("50%")
game.Players.LocalPlayer.Character=ch
wait(6)
warn("100%")
end;
Respawn = function()
local ch = game.Players.LocalPlayer.Character
ChatHUDFunc = function()
--[[
Variables
--]]
Template.Parent = nil
ChatHUD.Parent = game:GetService("CoreGui")
--[[
Code
--]]
Global.Font = Enum.Font.SourceSansBold
Local.Font = Enum.Font.SourceSans
GlobalFrame.Visible = true
LocalFrame.Visible = false
end
Global.Font = Enum.Font.SourceSans
Local.Font = Enum.Font.SourceSansBold
GlobalFrame.Visible = false
LocalFrame.Visible = true
end
Global.MouseButton1Down:Connect(OpenGlobalTab)
Local.MouseButton1Down:Connect(OpenLocalTab)
Global.MouseButton1Click:Connect(OpenGlobalTab)
Local.MouseButton1Click:Connect(OpenLocalTab)
OpenLocalTab()
--
delay(60, function()
Frame:Destroy()
end)
end
delay(60, function()
Frame:Destroy()
end)
end
Player.Chatted:Connect(function(Message)
OnNewChat(Message, Player, Color)
end)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
--
local ChatPart = ChatHUD.Part
ChatHUD.Adornee = ChatPart
if VRReady then
ChatHUD.Parent = game:GetService("CoreGui")
ChatHUD.Enabled = true
ChatHUD.AlwaysOnTop = true
local CharacterAdded
CharacterAdded = Client.CharacterAdded:Connect(function()
OnInput:Disconnect()
RenderStepped:Disconnect()
CharacterAdded:Disconnect()
ChatHUD:Destroy()
ChatHUD = nil
end)
end
wait(9e9)
end;
ViewHUDFunc = function()
--[[
Variables
--]]
ViewHUD.Parent = game:GetService("CoreGui")
Viewcam.Parent = Viewport
Viewcam.CameraType = Enum.CameraType.Scriptable
Viewport.CurrentCamera = Viewcam
Viewport.BackgroundTransparency = 1
--[[
Code
--]]
Character.Archivable = true
Clone = Character:Clone()
Character.Archivable = Arc
return Clone
end
Character:WaitForChild("Head")
Character:WaitForChild("Humanoid")
wait(3)
for i = 1, #Descendants do
local Part = Descendants[i]
local Real = Part:IsA("BasePart") and GetPart(Part.Name,
Part.Parent.Name, RealDescendants)
if Part.Parent:IsA("Accessory") then
Part.Transparency = 0
end
RenderConnection = RunService.RenderStepped:Connect(function()
if not Character or not Character.Parent then
RenderConnection:Disconnect()
FakeChar:Destroy()
return
end
FakeChar.Parent = Viewcam
end
Player.CharacterAdded:Connect(CharacterAdded)
if Player.Character then
spawn(function()
CharacterAdded(Player.Character)
end)
end
end
ViewPart.Size = Vector3.new()
if VRReady then
Viewport.Position = UDim2.new(.62, 0, .89, 0)
Viewport.Size = UDim2.new(.3, 0, .3, 0)
Viewport.AnchorPoint = Vector2.new(.5, 1)
else
Viewport.Size = UDim2.new(0.3, 0, 0.3, 0)
end
if VRReady then
Render = Render * VRService:GetUserCFrame(Enum.UserCFrame.Head)
end
Viewport.Camera.CFrame = CameraPort
--
local CharacterAdded
CharacterAdded = Client.CharacterAdded:Connect(function()
RenderStepped:Disconnect()
CharacterAdded:Disconnect()
PlayerAdded:Disconnect()
ViewHUD:Destroy()
ViewHUD = nil
end)
wait(9e9)
end;
Script()
wait(2)