CLOVR: Full-Body VR Script Update
CLOVR: Full-Body VR Script Update
-- This is an older version of CLOVR, I found that the legs would 'walk' better in
this version than the one we released.
--Controls are a bit different from last release because this is older. Still works
good!
--RagDollEnabled is set to true, DON'T set it to false or CLOVR won't work. Feel
free to change the other settings though. -Abacaxl
--|| 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 = [Link](.5, 0, 0),
LeftOffset = [Link](-.5, 0, 0),
}
--|| Script:
Script = function()
--[[
Variables
--]]
[Link] = true
[Link] = 1
[Link] = false
[Link] = workspace
if RagdollEnabled then
print("RagdollEnabled, thank you for using CLOVR!")
local NetworkAccess = [Link](function()
settings().[Link] = 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
[Link] = 0.1 [Link] = 0 end end
game:GetService("Players").[Link] =
[Link]([Link],[Link])
game:GetService("Players").[Link] = [Link]*[Link] end
end)
[Link](NetworkAccess)
end
--[[
Character Protection
--]]
if HideCharacter then
local Platform = [Link]("Part")
[Link] = true
[Link] = [Link](100, 5, 100)
[Link] = [Link](0, 10000, 0)
[Link] = 1
[Link] = workspace
wait(.5)
end
if AnchorCharacter then
for _, Part in pairs(Character:GetChildren()) do
if Part:IsA("BasePart") then
[Link] = true
end
end
end
end
--[[
Functions
--]]
[Link]:Connect(function()
tween:Destroy()
end)
tween:Play()
return tween
end
Orientation.Attachment0 = Attachment1
Orientation.Attachment1 = Attachment0
[Link] = false
[Link] = 20000
[Link] = 40
[Link] = [Link]
Position.Attachment0 = Attachment1
Position.Attachment1 = Attachment0
[Link] = false
[Link] = 40000
[Link] = 40
[Link] = [Link]
[Link] = false
wait(.2)
[Link] = "RightGrip"
RightGrip.Part1 = Handle
RightGrip.Part0 = WeldBase
[Link] = WeldBase
return RightGrip
end
if DeleteMeshes then
if [Link]:FindFirstChild("Mesh") then
[Link]:Destroy()
end
end
wait()
[Link] = true
[Link] = 0.5
UsedAccessories[Accessory] = true
wait()
pcall(function()
[Link] = false
end)
end
end
do
[Link] = 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 =
[Link]:FindFirstChildWhichIsA("Attachment")
local Attachment0 =
Character:FindFirstChild(tostring(Attachment1), true)
Orientation.Attachment0 = Attachment1
Orientation.Attachment1 = Attachment0
[Link] = false
[Link] = true
[Link] = 20000
[Link] = 40
[Link] = [Link]
Position.Attachment0 = Attachment1
Position.Attachment1 = Attachment0
[Link] = false
[Link] = true
[Link] = 40000
[Link] = 40
[Link] = [Link]
end
end
end
end
--[[
Movement
--]]
[Link] = "VirtualRig"
[Link] = CharacterCFrame.p
[Link] = CharacterCFrame.p
[Link] = workspace
VirtualRig:SetPrimaryPartCFrame(CharacterCFrame)
[Link] = 0
VirtualRig:BreakJoints()
--
[Link] = workspace
[Link] = "VirtualBody"
[Link] = 8
[Link] = [Link](0, StudsOffset, 0)
VirtualBody:SetPrimaryPartCFrame(CharacterCFrame)
[Link]:Connect(function()
print("Virtual death")
if AutoRespawn then
Character:BreakJoints()
[Link] = [Link]
[Link] = 0
[Link] = 1
[Link]:Connect(function()
[Link] = true
end)
[Link]:Connect(function()
[Link] = true
end)
--[[
VR Replication
--]]
if RagdollEnabled then
for _, Part in pairs(Character:GetDescendants()) do
if Part:IsA("BasePart") and [Link] == "Handle" and
[Link]:IsA("Accessory") then
[Link] = 1
elseif Part:IsA("BasePart") and [Link] < 0.5 and [Link]
~= "Head" then
[Link] = 0.5
elseif Part:IsA("BasePart") and [Link] == "Head" then
[Link] = 1
end
pcall(function()
[Link] = false
end)
end
end
end
if FloorPart then
return FloorPart, FloorPosition, FloorNormal, (FloorPosition -
Position).Magnitude
else
return nil, Target, [Link](), Distance
end
end
local function Flatten(CF)
local X,Y,Z = CF.X,CF.Y,CF.Z
local LX,LZ = [Link].X,[Link].Z
local FootTurn = 1
return
PastThreshold
or
PastTick
end
repeat
[Link]:Wait()
if
([Link] - [Link]).Y > 4
or
([Link] - [Link]).Y > 4
or
(([Link] - [Link]) * [Link](1,
0, 1)).Magnitude > 4
or
(([Link] - [Link]) * [Link](1, 0,
1)).Magnitude > 4
then
break
end
until tick() - Yield >= .17
end
Dist = [Link](Dist, 0, 5)
local FootTarget =
[Link] *
[Link]([Link]) -
[Link](0, Dist, 0) +
[Link] * ([Link] / 8)
* 2
FootYield()
local FootTarget =
[Link] *
[Link]([Link]) -
[Link](0, Dist, 0) +
[Link] * ([Link] / 8)
* 2
TorsoGrip.C1 = [Link]()
TorsoGrip.C0 =
TorsoGrip.C0:Lerp([Link]:ToObjectSpace(Positioning * [Link](0, -0.25,
0) * [Link]), Smoothness)
[Link] = nil
[Link] = Parent
end
else
local Positioning = [Link]
RightLegGrip.C1 = [Link]()
RightLegGrip.C0 =
RightLegGrip.C0:Lerp([Link]:ToObjectSpace(Positioning *
[Link]), Smoothness)
[Link] = nil
[Link] = Parent
end
if LeftHipHandle then
local Positioning =
[Link]
: Lerp([Link], 0.5)
+ [Link](0, 0.5, 0)
LeftLegGrip.C1 = [Link]()
LeftLegGrip.C0 =
LeftLegGrip.C0:Lerp([Link]:ToObjectSpace(Positioning *
[Link]), Smoothness)
[Link] = nil
[Link] = Parent
end
else
do
local Positioning =
[Link]
: Lerp([Link], 0.5)
* [Link](0, [Link](180), 0)
+ [Link](0, 0.5, 0)
MoveRightLeg(Positioning)
end
do
local Positioning =
[Link]
: Lerp([Link], 0.5)
* [Link](0, [Link](180), 0)
+ [Link](0, 0.5, 0)
MoveLeftLeg(Positioning)
end
end
end
if BasePart then
LocalPositioning = [Link] * HeadAtt
end
RightGrip.C1 = HatAtt
RightGrip.C0 =
RightGrip.C0:Lerp([Link]:ToObjectSpace(LocalPositioning), Smoothness)
[Link] = nil
[Link] = Parent
end
if AccurateHandPosition then
HandPosition = HandPosition * [Link](0, 0, 1)
end
if Point2 then
[Link] =
[Link]([Link], [Link], [Link])
[Link] = [Link] *
[Link]
elseif [Link] ~=
[Link](0, 0, 0) then
[Link] =
[Link](0, 0, 0)
end
elseif AccurateHandPosition then
LocalPositioning = HandPosition
end
RightHandGrip.C1 = [Link]()
RightHandGrip.C0 =
RightHandGrip.C0:Lerp([Link]:ToObjectSpace(HandPosition), Smoothness)
[Link] = nil
[Link] = Parent
--
EquippedGrip.C1 = [Link]
EquippedGrip.C0 =
EquippedGrip.C0:Lerp(ArmBaseCFrame:ToObjectSpace(LocalPositioning), Smoothness)
[Link] = nil
[Link] = Parent
end
LeftHandGrip.C1 = [Link]()
LeftHandGrip.C0 =
LeftHandGrip.C0:Lerp([Link]:ToObjectSpace(HandPosition), Smoothness)
[Link] = nil
[Link] = Parent
end
end
if RagdollEnabled then
if UserCFrame == [Link] and RagdollHeadMovement then
MoveHead(Positioning)
elseif UserCFrame == [Link] then
local Positioning = Positioning
if VRReady then
Positioning = Positioning * [Link]
end
MoveRightArm(Positioning)
if Point2 then
[Link] =
[Link]([Link], [Link], [Link])
[Link] = [Link] *
[Link]
elseif [Link] ~= [Link](0,
0, 0) then
[Link] = [Link](0, 0,
0)
end
elseif UserCFrame == [Link] then
local Positioning = Positioning
if VRReady then
Positioning = Positioning * [Link]
end
MoveLeftArm(Positioning)
if Point1 then
[Link] =
[Link]([Link], [Link], [Link])
[Link] = [Link] *
[Link]
elseif [Link] ~= [Link](0, 0,
0) then
[Link] = [Link](0, 0,
0)
end
end
end
end
if RagdollEnabled then
for _, Part in pairs(Character:GetChildren()) do
if Part:IsA("BasePart") then
[Link] = false
end
end
end
if NoCollision then
for _, Player in pairs(Players:GetPlayers()) do
if Player ~= Client and [Link] then
local Descendants = [Link]:GetDescendants()
for i = 1, #Descendants do
local Part = Descendants[i]
if Part:IsA("BasePart") then
[Link] = false
[Link] = [Link]()
[Link] = [Link]()
end
end
end
end
end
end)
if RagdollEnabled then
[Link] = [Link]
[Link] = [Link](0, 0, 0)
end
spawn(function()
while Character and [Link] do
FootYield()
UpdateFooting()
end
end)
--[[
Non-VR Support + VR Mechanics
--]]
--[[
Proper Cleanup
--]]
local OnReset
OnReset = [Link]: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]
[Link] = workspace
[Link] = false
[Link] = false
--
local CharacterAdded
CharacterAdded = [Link]:Connect(function()
RenderStepped:Disconnect()
Input:Disconnect()
CharacterAdded:Disconnect()
Pointer:Destroy()
Pointer = nil
end)
else
return
end
end
end;
Permadeath = function()
local ch = [Link]
local prt=[Link]("Model", workspace)
local z1 = [Link]("Part", prt)
[Link]="Torso"
[Link] = false
[Link] = true
local z2 =[Link]("Part", prt)
[Link]="Head"
[Link] = true
[Link] = false
local z3 =[Link]("Humanoid", prt)
[Link]="Humanoid"
[Link] = [Link](0,9999,0)
[Link] = [Link](0,9991,0)
[Link]=prt
wait(5)
warn("50%")
[Link]=ch
wait(6)
warn("100%")
end;
Respawn = function()
local ch = [Link]
ChatHUDFunc = function()
--[[
Variables
--]]
[Link] = nil
[Link] = game:GetService("CoreGui")
--[[
Code
--]]
[Link] = [Link]
[Link] = [Link]
[Link] = true
[Link] = false
end
[Link] = [Link]
[Link] = [Link]
[Link] = false
[Link] = 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
[Link]:Connect(function(Message)
OnNewChat(Message, Player, Color)
end)
end
[Link]:Connect(OnPlayerAdded)
--
[Link] = ChatPart
if VRReady then
[Link] = game:GetService("CoreGui")
[Link] = true
[Link] = true
local CharacterAdded
CharacterAdded = [Link]:Connect(function()
OnInput:Disconnect()
RenderStepped:Disconnect()
CharacterAdded:Disconnect()
ChatHUD:Destroy()
ChatHUD = nil
end)
end
wait(9e9)
end;
ViewHUDFunc = function()
--[[
Variables
--]]
[Link] = game:GetService("CoreGui")
[Link] = Viewport
[Link] = [Link]
[Link] = Viewcam
[Link] = 1
--[[
Code
--]]
[Link] = true
Clone = Character:Clone()
[Link] = Arc
return Clone
end
Character:WaitForChild("Head")
Character:WaitForChild("Humanoid")
wait(3)
[Link] = "None"
for i = 1, #Descendants do
local Part = Descendants[i]
local Real = Part:IsA("BasePart") and GetPart([Link],
[Link], RealDescendants)
if [Link]:IsA("Accessory") then
[Link] = 0
end
RenderConnection = [Link]:Connect(function()
if not Character or not [Link] then
RenderConnection:Disconnect()
FakeChar:Destroy()
return
end
[Link] = Viewcam
end
[Link]:Connect(CharacterAdded)
if [Link] then
spawn(function()
CharacterAdded([Link])
end)
end
end
[Link] = [Link]()
if VRReady then
[Link] = [Link](.62, 0, .89, 0)
[Link] = [Link](.3, 0, .3, 0)
[Link] = [Link](.5, 1)
else
[Link] = [Link](0.3, 0, 0.3, 0)
end
if VRReady then
Render = Render * VRService:GetUserCFrame([Link])
end
[Link] = CameraPort
--
local CharacterAdded
CharacterAdded = [Link]:Connect(function()
RenderStepped:Disconnect()
CharacterAdded:Disconnect()
PlayerAdded:Disconnect()
ViewHUD:Destroy()
ViewHUD = nil
end)
wait(9e9)
end;
Script()
wait(2)





![else
Handle:BreakJoints()
end
Handle.Massless = true
Handle.Transparency = 0.5
UsedAccessories[Accessory] = true
local RightG](https://screenshots.scribd.com/Scribd/252_100_85/326/484840514/6.jpeg)

![Movement
--]]
VirtualRig.Name = "VirtualRig"
VirtualRig.RightFoot.BodyPosition.Position = CharacterCFrame.p
VirtualRig.LeftFo](https://screenshots.scribd.com/Scribd/252_100_85/326/484840514/8.jpeg)

