VRR
VRR
local rs = game:GetService("RunService")
local uis = game:GetService("UserInputService")
local cam = workspace.Camera
local headset
local p
local bodybinds = {
[Enum.KeyCode.Q] = "lHand",
[Enum.KeyCode.E] = "rHand",
[Enum.KeyCode.W] = Vector3.new(0, 1, 0),
[Enum.KeyCode.A] = Vector3.new(-1, 0, 0),
[Enum.KeyCode.S] = Vector3.new(0, -1, 0),
[Enum.KeyCode.D] = Vector3.new(1, 0, 0),
[Enum.KeyCode.G] = false,
[Enum.KeyCode.F] = true,
[Enum.KeyCode.LeftShift] = 1,
[Enum.KeyCode.LeftControl] = 2,
[Enum.KeyCode.LeftAlt] = 3
}
local gesturebinds = {
"Fist",
"Index",
"Thumb"
}
local events = {}
local cfs = {
[Enum.UserCFrame.Head] = CFrame.new(0, 0, 0),
[Enum.UserCFrame.LeftHand] = CFrame.new(-1, 0, -1),
[Enum.UserCFrame.RightHand] = CFrame.new(1, 0, -1)
}, {
__index = function(t, k)
local real = ind(realVrService, k)
if typeof(real) == "RBXScriptSignal" then
events[k] = events[k] or {
Name = k,
Connect = function(t, f)
t.Function = f
debug.setupvalue(headset.UpdateHand, 5,
setmetatable({}, {
__index = function(t, k)
return cam[k]
end,
__newindex = function(t, k, v)
if cam.CameraType ==
Enum.CameraType.Scriptable and p then -- unfortunately the first time this will run
may or may not be before the cameratype is set
cam.CameraType =
Enum.CameraType.Custom
cam.CameraSubject =
headset.Head
end
if k ~= "CFrame" then -- fuck you
cam[k] = v
end
end
}))
cam:GetPropertyChangedSignal("CameraSubject"):connect(function()
if cam.CameraSubject ~= headset.Head then
cam.CameraSubject = headset.Head
end
end)
end
end,
Fire = function(t, ...)
return t.Function(...)
end
}
return events[k]
end
return real
end,
__call = function(t, method, vr, ...)
return t[method](...)
end
})
return ind(...)
end)
if t == realVrService then
local method = getnamecallmethod()
return fakeVrService(method, ...)
end
return nc(...)
end)
nind(t, k, v)
end)
uis.InputEnded:connect(function(i)
if headset then
if i.UserInputType == Enum.UserInputType.Keyboard then
body(i.KeyCode, -1)
elseif i.UserInputType == Enum.UserInputType.MouseButton1 or
i.UserInputType == Enum.UserInputType.MouseButton2 or i.UserInputType ==
Enum.UserInputType.MouseButton3 then
body(i.UserInputType, -1)
end
end
end)
rs:BindToRenderStep(game:GetService("HttpService"):GenerateGUID(),
Enum.RenderPriority.Camera.Value - 1, function() -- at least it works
if events.UserCFrameChanged and headset then
local mpos = uis:GetMouseLocation()
events.UserCFrameChanged:Fire(Enum.UserCFrame.LeftHand, lcf *
CFrame.Angles(cam.CFrame:ToEulerAnglesXYZ()))
events.UserCFrameChanged:Fire(Enum.UserCFrame.RightHand, rcf *
CFrame.Angles(cam.CFrame:ToEulerAnglesXYZ()))
end
end)
p = plyrs.LocalPlayer or (function()
plyrs:GetPropertyChangedSignal("LocalPlayer"):wait() -- this doesnt return
anything for some reason??
return plyrs.LocalPlayer
end)()