Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- _
- | |
- __ ___ __ __ _ _ __ _ ___ _| |__ ___ _ __ ___
- \ \ / / '__| / _` | '_ \| | | \ \ /\ / / '_ \ / _ \ '__/ _ \
- \ V /| | | (_| | | | | |_| |\ V V /| | | | __/ | | __/
- \_/ |_| \__,_|_| |_|\__, | \_/\_/ |_| |_|\___|_| \___|
- __/ |
- |___/
- _ _ _
- | | | | | |
- | |__ _ _ ___| | _____ __| |
- | '_ \| | | | / __| |/ / _ \/ _` |
- | |_) | |_| | \__ \ < __/ (_| |
- |_.__/ \__, | |___/_|\_\___|\__,_|
- __/ |
- |___/
- ]]
- local options = {}
- -- OPTIONS:
- options.headhat = "OverseerGuardia" -- name of the accessory which you are using as a head
- options.headscale = 3 -- how big you are in vr, 1 is default, 3 is recommended for max comfort in vr
- options.forcebubblechat = true -- decide if to force bubblechat so you can see peoples messages
- options.righthandhat = "PurpleHair"
- options.lefthandhat = "Ultra-Fabulous Hair"
- options.righthandrotoffset = Vector3.new(0,0,0)
- options.lefthandrotoffset = Vector3.new(0,0,0)
- --
- local plr = game:GetService("Players").LocalPlayer
- local char = plr.Character
- local backpack = plr.Backpack
- local VR = game:GetService("VRService")
- local input = game:GetService("UserInputService")
- local cam = workspace.CurrentCamera
- cam.CameraType = "Scriptable"
- cam.HeadScale = options.headscale
- game:GetService("StarterGui"):SetCore("VRLaserPointerMode", 0)
- game:GetService("StarterGui"):SetCore("VREnableControllerModels", false)
- local handL
- local handR
- local head
- local R1down = false
- --local copy = game:GetObjects('rbxassetid://4469710589')[1]
- --local copy = game:GetService("InsertService"):LoadAsset(4469710589):GetChildren()[1]
- --local copy = game.ReplicatedStorage.Dummy:Clone()
- local function loadhat(hat)
- local tool = Instance.new("Tool")
- local handle = hat.Handle
- handle:FindFirstChildOfClass("Weld"):Destroy()
- handle.Massless = true
- handle.CanCollide = true
- handle.Parent = tool
- tool.Name = hat.Name
- tool.Parent = backpack
- tool.Parent = char
- return tool
- end
- for i,v in pairs(char.Humanoid:GetAccessories()) do
- if v:FindFirstChild("Handle") then
- --local tool = Instance.new("Tool")
- --tool.Name = v.Name..i
- local handle = v.Handle
- if v.Name == options.righthandhat and not handR then
- handle:FindFirstChildOfClass("SpecialMesh"):Destroy()
- handR = loadhat(v)
- elseif v.Name == options.lefthandhat and not handL then
- handle:FindFirstChildOfClass("SpecialMesh"):Destroy()
- handL = loadhat(v)
- elseif v.Name == options.headhat and not head then
- handle.Transparency = 1
- head = loadhat(v)
- end
- end
- end
- --[[
- local an = Instance.new("Animation",workspace)
- an.AnimationId = "rbxassetid://31319431"
- char.Humanoid:LoadAnimation(an):Play()
- an:Remove()
- ]]
- char.Humanoid.AnimationPlayed:connect(function(anim)
- anim:Stop()
- end)
- for i,v in pairs(char.Humanoid:GetPlayingAnimationTracks()) do
- v:AdjustSpeed(0)
- end
- local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
- torso.Anchored = true
- char.HumanoidRootPart.Anchored = true
- --[[
- local function move(tool,pos)
- local armcframe = char['Right Arm'].CFrame * CFrame.new(0, -1, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
- local cf = armcframe:toObjectSpace(pos):inverse()
- tool.Parent = backpack
- tool.Grip = cf
- tool.Parent = char
- end
- ]]
- --[[
- copy.Parent = workspace
- copy.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame
- --game.Players.LocalPlayer.Character = copy
- cam.CameraSubject = copy.Humanoid
- copy.Humanoid.CameraOffset = Vector3.new(0, 5.4, 0)
- ]]
- workspace.CurrentCamera.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position)
- input.UserCFrameChanged:connect(function(part,move)
- if part == Enum.UserCFrame.Head then
- --move(head,cam.CFrame*move)
- local rArm = char:FindFirstChild("Right Arm") or char:FindFirstChild("RightLowerArm")
- local armcframe = rArm.CFrame * CFrame.new(0, -1, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
- local cf = armcframe:toObjectSpace(cam.CFrame*(CFrame.new(move.p*(cam.HeadScale-1))*move)):inverse()
- head.Parent = backpack
- head.Grip = cf
- head.Parent = char
- elseif part == Enum.UserCFrame.LeftHand then
- --move(handL,cam.CFrame*move)
- local rArm = char:FindFirstChild("Right Arm") or char:FindFirstChild("RightLowerArm")
- local armcframe = rArm.CFrame * CFrame.new(0, -1, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
- local cf = armcframe:toObjectSpace(cam.CFrame*(CFrame.new(move.p*(cam.HeadScale-1))*move*CFrame.Angles(math.rad(options.righthandrotoffset.X),math.rad(options.righthandrotoffset.Y),math.rad(options.righthandrotoffset.Z)))):inverse()
- handL.Parent = backpack
- handL.Grip = cf
- handL.Parent = char
- elseif part == Enum.UserCFrame.RightHand then
- --move(handR,cam.CFrame*move)
- local rArm = char:FindFirstChild("Right Arm") or char:FindFirstChild("RightLowerArm")
- local armcframe = rArm.CFrame * CFrame.new(0, -1, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
- local cf = armcframe:toObjectSpace(cam.CFrame*(CFrame.new(move.p*(cam.HeadScale-1))*move*CFrame.Angles(math.rad(options.righthandrotoffset.X),math.rad(options.righthandrotoffset.Y),math.rad(options.righthandrotoffset.Z)))):inverse()
- handR.Parent = backpack
- handR.Grip = cf
- handR.Parent = char
- end
- end)
- input.InputChanged:connect(function(key)
- if key.KeyCode == Enum.KeyCode.ButtonR1 then
- if key.Position.Z > 0.9 then
- R1down = true
- else
- R1down = false
- end
- end
- end)
- input.InputBegan:connect(function(key)
- if key.KeyCode == Enum.KeyCode.ButtonR1 then
- R1down = true
- end
- end)
- input.InputEnded:connect(function(key)
- if key.KeyCode == Enum.KeyCode.ButtonR1 then
- R1down = false
- end
- end)
- game:GetService("RunService").RenderStepped:connect(function()
- if R1down then
- cam.CFrame = cam.CFrame:Lerp(cam.CoordinateFrame + (handR.Handle.CFrame*CFrame.Angles(-math.rad(options.righthandrotoffset.X),-math.rad(options.righthandrotoffset.Y),math.rad(180-options.righthandrotoffset.X))).LookVector * cam.HeadScale/2, 0.5)
- end
- end)
- --[[
- game:GetService("RunService").RenderStepped:connect(function(step)
- copy.Humanoid:MoveTo(copy.HumanoidRootPart.Position + char.Humanoid.MoveDirection * 6)
- end)
- ]]
- local function bubble(plr,msg)
- game:GetService("Chat"):Chat(plr.Character.Head,msg,Enum.ChatColor.White)
- end
- if options.forcebubblechat == true then
- game.Players.PlayerAdded:connect(function(plr)
- plr.Chatted:connect(function(msg)
- game:GetService("Chat"):Chat(plr.Character.Head,msg,Enum.ChatColor.White)
- end)
- end)
- for i,v in pairs(game.Players:GetPlayers()) do
- v.Chatted:connect(function(msg)
- game:GetService("Chat"):Chat(v.Character.Head,msg,Enum.ChatColor.White)
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement