Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(2)
- local size = 5
- -- don't mind my messy, unorganized code, just focus on the beauty of the script!
- local VRService = game:GetService("VRService")
- local RunService = game:GetService("RunService")
- local lh = Instance.new("Part",workspace)
- local mode = 0
- local lastmode = 0
- local maxmodes = 8
- local pensize = size/5
- local distance = 1*pensize
- local player = game.Players.LocalPlayer
- local us = game:GetService("UserInputService")
- local drawing = false
- local lastpart = nil
- local lastpart2 = nil
- local lastline = nil
- local folder = nil
- --
- local oldpart = nil
- local currentpartR = nil
- local currentcfR = nil
- local currentpartL = nil
- local currentcfL = nil
- local velR = Vector3.new(0,0,0)
- local lastposR = Vector3.new(0,0,0)
- local velL = Vector3.new(0,0,0)
- local lastposL = Vector3.new(0,0,0)
- local yeetstr = 1.45
- local npR = false
- local npL = false
- while workspace:FindFirstChild("dksfbfkhsdhbfsjhd") ~= nil do
- workspace:FindFirstChild("dksfbfkhsdhbfsjhd"):Destroy()
- end
- lh.Transparency = 0
- lh.Size = Vector3.new(0.2,0.2,0.6) * Vector3.new(size,size,size)
- lh.Material = "Metal"
- lh.Color = Color3.fromRGB(255,100,255)
- lh.Name = "dksfbfkhsdhbfsjhd"
- lh.CanCollide = false
- lh.Anchored = true
- local rh = Instance.new("Part",workspace)
- rh.Transparency = 0
- rh.Size = Vector3.new(0.2,0.2,0.6) * Vector3.new(size,size,size)
- rh.Material = "Metal"
- rh.Name = "dksfbfkhsdhbfsjhd"
- rh.Color = Color3.fromRGB(255,100,255)
- rh.CanCollide = false
- rh.Anchored = true
- local selec1 = Instance.new("SelectionBox",lh)
- selec1.Color3 = Color3.fromRGB(255,0,255)
- selec1.LineThickness = 0.15
- local selec2 = Instance.new("SelectionBox",rh)
- selec2.Color3 = Color3.fromRGB(255,0,255)
- selec2.LineThickness = 0.15
- local he = Instance.new("Part",workspace)
- he.Size = Vector3.new(2,2,2) * Vector3.new(size,size,size)
- he.CanCollide = false
- he.Transparency = 1
- he.Anchored = true
- local antispamright = false
- local antispamleft = false
- local laserrh = Instance.new("Part")
- laserrh.Color = Color3.fromRGB(255, 75, 230)
- laserrh.Name = "dksfbfkhsdhbfsjhd"
- laserrh.Material = "Neon"
- laserrh.Transparency = 1
- laserrh.Parent = workspace
- laserrh.CanCollide = false
- laserrh.Anchored = true
- local laserlh = Instance.new("Part")
- laserlh.Color = Color3.fromRGB(255, 75, 230)
- laserlh.Material = "Neon"
- laserlh.Transparency = 1
- laserlh.Name = "dksfbfkhsdhbfsjhd"
- laserlh.Parent = workspace
- laserlh.CanCollide = false
- laserlh.Anchored = true
- game.StarterGui:SetCore("VRLaserPointerMode", 0)
- game.StarterGui:SetCore("VREnableControllerModels", false)
- local Partt = Instance.new("Part")
- local SurfaceGui = Instance.new("SurfaceGui")
- local OuterFrame = Instance.new("Frame")
- local _0 = Instance.new("Frame")
- local TextLabel = Instance.new("TextLabel")
- local _1 = Instance.new("Frame")
- local TextLabel_2 = Instance.new("TextLabel")
- local _2 = Instance.new("Frame")
- local TextLabel_3 = Instance.new("TextLabel")
- local _3 = Instance.new("Frame")
- local TextLabel_4 = Instance.new("TextLabel")
- local _4 = Instance.new("Frame")
- local TextLabel_5 = Instance.new("TextLabel")
- local _5 = Instance.new("Frame")
- local TextLabel_6 = Instance.new("TextLabel")
- local _6 = Instance.new("Frame")
- local TextLabel_7 = Instance.new("TextLabel")
- local _7 = Instance.new("Frame")
- local TextLabel_8 = Instance.new("TextLabel")
- local _8 = Instance.new("Frame")
- local TextLabel_9 = Instance.new("TextLabel")
- local _9 = Instance.new("Frame")
- local TextLabel_10 = Instance.new("TextLabel")
- local _10 = Instance.new("Frame")
- local TextLabel_11 = Instance.new("TextLabel")
- --Properties:
- Partt.Transparency = 1
- Partt.CanCollide = false
- Partt.Size = Vector3.new(0.668*size, 0.77*size, 0.05*size)
- Partt.Anchored = true
- Partt.Name = "dksfbfkhsdhbfsjhd"
- Partt.Parent = workspace
- SurfaceGui.Parent = Partt
- SurfaceGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- SurfaceGui.AlwaysOnTop = true
- SurfaceGui.CanvasSize = Vector2.new(1600, 1700)
- OuterFrame.Name = "OuterFrame"
- OuterFrame.Parent = SurfaceGui
- OuterFrame.AnchorPoint = Vector2.new(1, 0)
- OuterFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- OuterFrame.BackgroundTransparency = 1.000
- OuterFrame.Position = UDim2.new(1, 0, 0, 0)
- OuterFrame.Size = UDim2.new(1, 0, 1, 0)
- _0.Name = "0"
- _0.Parent = OuterFrame
- _0.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _0.BackgroundTransparency = 0.400
- _0.BorderSizePixel = 0
- _0.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel.Parent = _0
- TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel.BackgroundTransparency = 1.000
- TextLabel.Size = UDim2.new(1, 0, 1, 0)
- TextLabel.Font = Enum.Font.SourceSans
- TextLabel.Text = ""
- TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel.TextScaled = true
- TextLabel.TextSize = 14.000
- TextLabel.TextWrapped = true
- TextLabel.TextXAlignment = Enum.TextXAlignment.Left
- _1.Name = "1"
- _1.Parent = OuterFrame
- _1.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _1.BackgroundTransparency = 0.400
- _1.BorderSizePixel = 0
- _1.Position = UDim2.new(0, 0, 0.0909090936, 0)
- _1.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel_2.Parent = _1
- TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel_2.BackgroundTransparency = 1.000
- TextLabel_2.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_2.Font = Enum.Font.SourceSans
- TextLabel_2.Text = ""
- TextLabel_2.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_2.TextScaled = true
- TextLabel_2.TextSize = 14.000
- TextLabel_2.TextWrapped = true
- TextLabel_2.TextXAlignment = Enum.TextXAlignment.Left
- _2.Name = "2"
- _2.Parent = OuterFrame
- _2.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _2.BackgroundTransparency = 0.400
- _2.BorderSizePixel = 0
- _2.Position = UDim2.new(0, 0, 0.181818187, 0)
- _2.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel_3.Parent = _2
- TextLabel_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel_3.BackgroundTransparency = 1.000
- TextLabel_3.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_3.Font = Enum.Font.SourceSans
- TextLabel_3.Text = ""
- TextLabel_3.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_3.TextScaled = true
- TextLabel_3.TextSize = 14.000
- TextLabel_3.TextWrapped = true
- TextLabel_3.TextXAlignment = Enum.TextXAlignment.Left
- _3.Name = "3"
- _3.Parent = OuterFrame
- _3.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _3.BackgroundTransparency = 0.400
- _3.BorderSizePixel = 0
- _3.Position = UDim2.new(0, 0, 0.272727281, 0)
- _3.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel_4.Parent = _3
- TextLabel_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel_4.BackgroundTransparency = 1.000
- TextLabel_4.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_4.Font = Enum.Font.SourceSans
- TextLabel_4.Text = ""
- TextLabel_4.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_4.TextScaled = true
- TextLabel_4.TextSize = 14.000
- TextLabel_4.TextWrapped = true
- TextLabel_4.TextXAlignment = Enum.TextXAlignment.Left
- _4.Name = "4"
- _4.Parent = OuterFrame
- _4.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _4.BackgroundTransparency = 0.400
- _4.BorderSizePixel = 0
- _4.Position = UDim2.new(0, 0, 0.363636374, 0)
- _4.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel_5.Parent = _4
- TextLabel_5.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel_5.BackgroundTransparency = 1.000
- TextLabel_5.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_5.Font = Enum.Font.SourceSans
- TextLabel_5.Text = ""
- TextLabel_5.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_5.TextScaled = true
- TextLabel_5.TextSize = 14.000
- TextLabel_5.TextWrapped = true
- TextLabel_5.TextXAlignment = Enum.TextXAlignment.Left
- _5.Name = "5"
- _5.Parent = OuterFrame
- _5.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _5.BackgroundTransparency = 0.400
- _5.BorderSizePixel = 0
- _5.Position = UDim2.new(0, 0, 0.454545468, 0)
- _5.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel_6.Parent = _5
- TextLabel_6.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel_6.BackgroundTransparency = 1.000
- TextLabel_6.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_6.Font = Enum.Font.SourceSans
- TextLabel_6.Text = ""
- TextLabel_6.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_6.TextScaled = true
- TextLabel_6.TextSize = 14.000
- TextLabel_6.TextWrapped = true
- TextLabel_6.TextXAlignment = Enum.TextXAlignment.Left
- _6.Name = "6"
- _6.Parent = OuterFrame
- _6.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _6.BackgroundTransparency = 0.400
- _6.BorderSizePixel = 0
- _6.Position = UDim2.new(0, 0, 0.545454562, 0)
- _6.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel_7.Parent = _6
- TextLabel_7.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel_7.BackgroundTransparency = 1.000
- TextLabel_7.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_7.Font = Enum.Font.SourceSans
- TextLabel_7.Text = ""
- TextLabel_7.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_7.TextScaled = true
- TextLabel_7.TextSize = 14.000
- TextLabel_7.TextWrapped = true
- TextLabel_7.TextXAlignment = Enum.TextXAlignment.Left
- _7.Name = "7"
- _7.Parent = OuterFrame
- _7.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _7.BackgroundTransparency = 0.400
- _7.BorderSizePixel = 0
- _7.Position = UDim2.new(0, 0, 0.636363626, 0)
- _7.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel_8.Parent = _7
- TextLabel_8.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel_8.BackgroundTransparency = 1.000
- TextLabel_8.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_8.Font = Enum.Font.SourceSans
- TextLabel_8.Text = ""
- TextLabel_8.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_8.TextScaled = true
- TextLabel_8.TextSize = 14.000
- TextLabel_8.TextWrapped = true
- TextLabel_8.TextXAlignment = Enum.TextXAlignment.Left
- _8.Name = "8"
- _8.Parent = OuterFrame
- _8.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _8.BackgroundTransparency = 0.400
- _8.BorderSizePixel = 0
- _8.Position = UDim2.new(0, 0, 0.727272749, 0)
- _8.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel_9.Parent = _8
- TextLabel_9.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel_9.BackgroundTransparency = 1.000
- TextLabel_9.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_9.Font = Enum.Font.SourceSans
- TextLabel_9.Text = ""
- TextLabel_9.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_9.TextScaled = true
- TextLabel_9.TextSize = 14.000
- TextLabel_9.TextWrapped = true
- TextLabel_9.TextXAlignment = Enum.TextXAlignment.Left
- _9.Name = "9"
- _9.Parent = OuterFrame
- _9.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _9.BackgroundTransparency = 0.400
- _9.BorderSizePixel = 0
- _9.Position = UDim2.new(0, 0, 0.818181813, 0)
- _9.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel_10.Parent = _9
- TextLabel_10.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel_10.BackgroundTransparency = 1.000
- TextLabel_10.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_10.Font = Enum.Font.SourceSans
- TextLabel_10.Text = ""
- TextLabel_10.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_10.TextScaled = true
- TextLabel_10.TextSize = 14.000
- TextLabel_10.TextWrapped = true
- TextLabel_10.TextXAlignment = Enum.TextXAlignment.Left
- _10.Name = "10"
- _10.Parent = OuterFrame
- _10.BackgroundColor3 = Color3.fromRGB(255, 160, 251)
- _10.BackgroundTransparency = 0.400
- _10.BorderSizePixel = 0
- _10.Position = UDim2.new(0, 0, 0.909090936, 0)
- _10.Size = UDim2.new(1, 0, 0.0909090936, 0)
- TextLabel_11.Parent = _10
- TextLabel_11.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel_11.BackgroundTransparency = 1.000
- TextLabel_11.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_11.Font = Enum.Font.SourceSans
- TextLabel_11.Text = ""
- TextLabel_11.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_11.TextScaled = true
- TextLabel_11.TextSize = 14.000
- TextLabel_11.TextWrapped = true
- TextLabel_11.TextXAlignment = Enum.TextXAlignment.Left
- --now to wait for the server if it isn't called yet!
- local remote = game.Players.LocalPlayer:WaitForChild("VrC")
- remote:FireServer("Start",size)
- wait(.5)
- workspace:WaitForChild(game.Players.LocalPlayer.Name.."-Head").Transparency = 1
- selec1.Adornee = workspace:WaitForChild(game.Players.LocalPlayer.Name.."-LeftHand")
- selec2.Adornee = workspace:WaitForChild(game.Players.LocalPlayer.Name.."-RightHand")
- workspace:WaitForChild(game.Players.LocalPlayer.Name.."-LeftHand").Transparency = 1
- workspace:WaitForChild(game.Players.LocalPlayer.Name.."-RightHand").Transparency = 1
- workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
- workspace.CurrentCamera.CFrame = CFrame.new(0,0,0) * CFrame.new(0,5*size,0)
- workspace.CurrentCamera.HeadScale = size
- if workspace:FindFirstChild("DrawStuff") == nil then
- folder = Instance.new("Folder",workspace)
- folder.Name = "DrawStuff"
- else
- folder = workspace:FindFirstChild("DrawStuff")
- end
- local function updatechat(mes)
- local a = Partt.SurfaceGui.OuterFrame["0"].TextLabel
- local b = Partt.SurfaceGui.OuterFrame["1"].TextLabel
- local c = Partt.SurfaceGui.OuterFrame["2"].TextLabel
- local d = Partt.SurfaceGui.OuterFrame["3"].TextLabel
- local e = Partt.SurfaceGui.OuterFrame["4"].TextLabel
- local f = Partt.SurfaceGui.OuterFrame["5"].TextLabel
- local g = Partt.SurfaceGui.OuterFrame["6"].TextLabel
- local h = Partt.SurfaceGui.OuterFrame["7"].TextLabel
- local i = Partt.SurfaceGui.OuterFrame["8"].TextLabel
- local j = Partt.SurfaceGui.OuterFrame["9"].TextLabel
- local k = Partt.SurfaceGui.OuterFrame["10"].TextLabel
- a.Text = b.Text
- b.Text = c.Text
- c.Text = d.Text
- d.Text = e.Text
- e.Text = f.Text
- f.Text = g.Text
- g.Text = h.Text
- h.Text = i.Text
- i.Text = j.Text
- j.Text = k.Text
- k.Text = mes
- end
- local function multiplyCFrame(a, b)
- local ax, ay, az, a11, a12, a13, a21, a22, a23, a31, a32, a33 = a:components()
- local bx, by, bz, b11, b12, b13, b21, b22, b23, b31, b32, b33 = b:components()
- local x = ax*bx
- local y = ay*by
- local z = az*bz
- local m11 = a11*b11
- local m12 = a12*b12
- local m13 = a13*b13
- local m21 = a21*b21
- local m22 = a22*b22
- local m23 = a23*b23
- local m31 = a31*b31
- local m32 = a32*b32
- local m33 = a33*b33
- return CFrame.new(x, y, z, m11, m12, m13, m21, m22, m23, m31, m32, m33)
- end
- function update()
- local fold = workspace.DrawStuff
- local tab = {}
- for i,v in pairs(fold:GetChildren()) do
- local teb = {}
- table.insert(teb,v.CFrame)
- table.insert(teb,v.Size)
- table.insert(teb,v.Shape)
- table.insert(tab,teb)
- end
- coroutine.resume(coroutine.create(function()
- remote:FireServer("UpdateDraw",tab)
- wait(.4)
- local g = workspace:FindFirstChild("FolderOfDraw"..player.Name)
- if g ~= nil then
- g:ClearAllChildren()
- end
- end))
- end
- function drawLine(part1,part2)
- local b1 = part1
- local b2 = part2
- local x = (b1.X+b2.X)/2
- local y = (b1.Y+b2.Y)/2
- local z = (b1.Z+b2.Z)/2
- local midpos = Vector3.new(x,y,z)
- local part = Instance.new("Part",folder)
- part.Anchored = true
- part.CanCollide = false
- part.Color = Color3.fromRGB(145,145,145)
- part.Position = midpos
- part.CFrame = CFrame.new(part.Position,b1)
- local mag = (b1 - b2).Magnitude
- part.Size = Vector3.new(0.4*(size/6),0.4*(size/6),mag)
- part.Material = "Neon"
- return part
- end
- function printtable(tab)
- for i,v in pairs(tab) do
- if type(v) ~= "table" then
- print(i.." | "..tostring(v))
- else
- for ii,vv in pairs(v) do
- print(i..", "..ii.." | "..tostring(v))
- end
- end
- end
- end
- function changeMode()
- if mode == 0 then
- lh.Color = Color3.fromRGB(255,100,255)
- rh.Color = Color3.fromRGB(255,100,255)
- selec1.Color3 = Color3.fromRGB(255,0,255)
- selec2.Color3 = Color3.fromRGB(255,0,255)
- laserlh.Color = Color3.fromRGB(255, 75, 230)
- laserrh.Color = Color3.fromRGB(255, 75, 230)
- elseif mode == 1 then
- lh.Color = Color3.fromRGB(100,100,255)
- rh.Color = Color3.fromRGB(100,100,255)
- selec1.Color3 = Color3.fromRGB(0,0,255)
- selec2.Color3 = Color3.fromRGB(0,0,255)
- elseif mode == 2 then
- lh.Color = Color3.fromRGB(255,100,100)
- rh.Color = Color3.fromRGB(255,100,100)
- selec1.Color3 = Color3.fromRGB(255,0,0)
- selec2.Color3 = Color3.fromRGB(255,0,0)
- elseif mode == 3 then
- lh.Color = Color3.fromRGB(100,255,100)
- rh.Color = Color3.fromRGB(100,255,100)
- selec1.Color3 = Color3.fromRGB(0,255,0)
- selec2.Color3 = Color3.fromRGB(0,255,0)
- laserlh.Color = Color3.fromRGB(100,255,100)
- laserrh.Color = Color3.fromRGB(100,255,100)
- laserlh.Transparency = 0.875
- laserrh.Transparency = 0.875
- elseif mode == 4 then
- lh.Color = Color3.fromRGB(0,255,178)
- rh.Color = Color3.fromRGB(0,255,178)
- selec1.Color3 = Color3.fromRGB(0,255,178)
- selec2.Color3 = Color3.fromRGB(0,255,178)
- laserlh.Color = Color3.fromRGB(0,255,178)
- laserrh.Color = Color3.fromRGB(0,255,178)
- laserlh.Transparency = 0.875
- laserrh.Transparency = 0.875
- elseif mode == 5 then
- lh.Color = Color3.fromRGB(255,255,100)
- rh.Color = Color3.fromRGB(255,255,100)
- selec1.Color3 = Color3.fromRGB(255,255,0)
- selec2.Color3 = Color3.fromRGB(255,255,0)
- elseif mode == 6 then
- lh.Color = Color3.fromRGB(100,255,255)
- rh.Color = Color3.fromRGB(100,255,255)
- lh.Transparency = 0.5
- rh.Transparency = 0.5
- selec1.Color3 = Color3.fromRGB(0,255,255)
- selec2.Color3 = Color3.fromRGB(0,255,255)
- elseif mode == 7 then
- lh.Color = Color3.fromRGB(255,255,255)
- rh.Color = Color3.fromRGB(255,255,255)
- selec1.Color3 = Color3.fromRGB(255,255,255)
- selec2.Color3 = Color3.fromRGB(255,255,255)
- elseif mode == 8 then
- lh.Color = Color3.fromRGB(100,100,100)
- rh.Color = Color3.fromRGB(100,100,100)
- selec1.Color3 = Color3.fromRGB(100,100,100)
- selec2.Color3 = Color3.fromRGB(100,100,100)
- end
- if mode ~= 3 and mode ~= 4 then
- laserlh.Transparency = 1
- laserrh.Transparency = 1
- end
- if lastmode == 6 then
- coroutine.resume(coroutine.create(function()
- lh.Transparency = 0
- rh.Transparency = 0
- wait(1)
- workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-LeftHand").Transparency = 1
- workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand").Transparency = 1
- workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-Head").Transparency = 1
- end))
- elseif lastmode == 7 then
- folder:ClearAllChildren()
- wait(.25)
- update()
- end
- remote:FireServer("mode",mode)
- lastmode = mode
- end
- function subtractcf(a, b)
- local x, y, z, m11, m12, m13, m21, m22, m23, m31, m32, m33 = a:components()
- return CFrame.new(x - b.x, y - b.y, z - b.z, m11, m12, m13, m21, m22, m23, m31, m32, m33);
- end
- local function multiplyCFrame(a, b)
- local ax, ay, az, a11, a12, a13, a21, a22, a23, a31, a32, a33 = a:components()
- local bx, by, bz, b11, b12, b13, b21, b22, b23, b31, b32, b33 = b:components()
- local x = ax*bx
- local y = ay*by
- local z = az*bz
- local m11 = a11*b11
- local m12 = a12*b12
- local m13 = a13*b13
- local m21 = a21*b21
- local m22 = a22*b22
- local m23 = a23*b23
- local m31 = a31*b31
- local m32 = a32*b32
- local m33 = a33*b33
- return CFrame.new(x, y, z, m11, m12, m13, m21, m22, m23, m31, m32, m33)
- end
- function isValid(targ)
- if targ.Anchored == false then
- return true
- else
- return false
- end
- end
- RunService.RenderStepped:Connect(function()
- workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
- local curr = workspace.CurrentCamera.CFrame
- local head = (VRService:GetUserCFrame(Enum.UserCFrame.Head) * CFrame.new(0,0,0.2)) + Vector3.new(0,1.25*(4*(1-size)),0)
- he.CFrame = multiplyCFrame((curr * head),CFrame.new(size, size, size, 1, 1, 1, 1, 1, 1, 1, 1, 1))
- local lefthand = (VRService:GetUserCFrame(Enum.UserCFrame.LeftHand) * CFrame.new(0,0,0.2)) + Vector3.new(0,1.25*(4*(1-size)),0)
- lh.CFrame = multiplyCFrame((curr * lefthand),CFrame.new(size, size, size, 1, 1, 1, 1, 1, 1, 1, 1, 1))
- local righthand = (VRService:GetUserCFrame(Enum.UserCFrame.RightHand) * CFrame.new(0,0,0.2)) + Vector3.new(0,1.25*(4*(1-size)),0)
- rh.CFrame = multiplyCFrame((curr * righthand),CFrame.new(size, size, size, 1, 1, 1, 1, 1, 1, 1, 1, 1))
- lh.Size = Vector3.new(0.2,0.2,0.6) * Vector3.new(size,size,size)
- rh.Size = Vector3.new(0.2,0.2,0.6) * Vector3.new(size,size,size)
- he.Size = Vector3.new(2,2,2) * Vector3.new(size,size,size)
- remote:FireServer("update",{lh.CFrame,rh.CFrame,he.CFrame,size})
- end)
- VRService:SetTouchpadMode(Enum.VRTouchpad.Right, Enum.VRTouchpadMode.ABXY)
- local UserInputService = game:GetService("UserInputService")
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if input.KeyCode == Enum.KeyCode.ButtonY then
- if size >= 1 then
- size = size + 1
- elseif size >= 10 then
- size = size + 2
- elseif size >= 50 then
- size = size + 5
- elseif size >= 200 then
- size = size + 20
- elseif size < 1 then
- size = size * 2
- end
- pensize = size/5
- distance = 1*pensize
- workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
- local bon = workspace.CurrentCamera.CFrame
- workspace.CurrentCamera.CFrame = CFrame.new(bon.X*-1,0,bon.Z*-1) * CFrame.new(0,5*size,0)
- workspace.CurrentCamera.HeadScale = size
- elseif input.KeyCode == Enum.KeyCode.ButtonA then
- if size <= 1 then
- size = size / 2
- elseif size <= 10 then
- size = size - 1
- elseif size > 10 then
- size = size - 2
- end
- pensize = size/5
- distance = 1*pensize
- distance = 1*pensize
- workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
- local bon = workspace.CurrentCamera.CFrame
- workspace.CurrentCamera.CFrame = CFrame.new(bon.X*-1,0,bon.Z*-1) * CFrame.new(0,5*size,0)
- workspace.CurrentCamera.HeadScale = size
- elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 0 then
- if antispamright == false then
- laserrh.Transparency = 0.875
- local csc = remote:FireServer("chargeright")
- antispamright = true
- end
- elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 0 then
- if antispamleft == false then
- laserlh.Transparency = 0.875
- local csc = remote:FireServer("chargeleft")
- antispamleft = true
- end
- elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 3 then
- if false == false then
- local csc = remote
- local plr = game.Players.LocalPlayer
- local ray = Ray.new(rh.CFrame.p,(rh.CFrame.LookVector) * 1000)
- print(tostring(workspace:FindPartOnRayWithIgnoreList(ray, {rh,workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand")})))
- csc:FireServer("GrabRight",{workspace:FindPartOnRayWithIgnoreList(ray, {rh,laserrh,laserlh,workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand")})})
- end
- elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 3 then
- if false == false then
- local csc = remote
- local plr = game.Players.LocalPlayer
- local ray = Ray.new(lh.CFrame.p,(lh.CFrame.LookVector) * 1000)
- csc:FireServer("GrabLeft",{workspace:FindPartOnRayWithIgnoreList(ray, {lh,laserrh,laserlh,workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-LeftHand")})})
- end
- elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 6 then
- local hit = (rh.CFrame * CFrame.new(0,0,-0.8*size)).p
- lastpart = hit
- drawing = true
- elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 4 then
- local ray = Ray.new(lh.CFrame.p,(lh.CFrame.LookVector) * 1000)
- local target = workspace:FindPartOnRayWithIgnoreList(ray, {lh,laserrh,laserlh,workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand")})
- if isValid(target) then
- lastposL = target.Position
- currentcfL = lh.CFrame:toObjectSpace(target.CFrame)
- currentpartL = target
- remote:FireServer("anchor",currentpartL)
- end
- elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 4 then
- local ray = Ray.new(rh.CFrame.p,(rh.CFrame.LookVector) * 1000)
- local target = workspace:FindPartOnRayWithIgnoreList(ray, {rh,laserrh,laserlh,workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand")})
- if isValid(target) then
- lastposR = target.Position
- currentcfR = rh.CFrame:toObjectSpace(target.CFrame)
- currentpartR = target
- remote:FireServer("anchor",currentpartR)
- end
- elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 8 then
- remote:FireServer("SpawnL")
- npL = true
- elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 8 then
- remote:FireServer("SpawnR")
- npR = true
- elseif input.KeyCode == Enum.KeyCode.ButtonL1 then
- if antispamleft == false and antispamright == false then
- --grip left
- mode = mode - 1
- if mode < 0 then
- mode = maxmodes
- end
- changeMode()
- end
- elseif input.KeyCode == Enum.KeyCode.ButtonR1 then
- if antispamleft == false and antispamright == false then
- --grip left
- mode = mode + 1
- if mode > maxmodes then
- mode = 0
- end
- changeMode()
- end
- end
- selec1.LineThickness = 0.0096 * size
- selec2.LineThickness = 0.0096 * size
- end)
- UserInputService.InputEnded:Connect(function(input, gameProcessed)
- if input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 0 then
- if antispamright == true then
- local csc = remote
- local plr = game.Players.LocalPlayer
- local tool = script.Parent
- local ray = Ray.new(rh.CFrame.p,(rh.CFrame.LookVector*Vector3.new(-1,-1,-1)) * 1000)
- csc:FireServer("ShootRight",{ray,rh.CFrame})
- laserrh.Transparency = 1
- antispamright = false
- end
- elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 0 then
- if antispamleft == true then
- local csc = remote
- local plr = game.Players.LocalPlayer
- local tool = script.Parent
- local ray = Ray.new(rh.CFrame.p,(rh.CFrame.LookVector*Vector3.new(-1,-1,-1)) * 1000)
- csc:FireServer("ShootLeft",{ray,lh.CFrame})
- laserlh.Transparency = 1
- antispamleft = false
- end
- elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 3 then
- remote:FireServer("UngrabRight")
- elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 3 then
- remote:FireServer("UngrabLeft")
- elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 4 then
- --currentpart.Velocity = Vector3.new(vel.X*(20*yeetstr),vel.Y*(20*yeetstr),vel.Z*(20*yeetstr))
- remote:FireServer("unanchor",{currentpartR,Vector3.new(velR.X*(20*yeetstr),velR.Y*(20*yeetstr),velR.Z*(20*yeetstr))})
- velR = Vector3.new(0,0,0)
- currentpartR = nil
- currentcfR = nil
- elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 4 then
- --currentpart.Velocity = Vector3.new(vel.X*(20*yeetstr),vel.Y*(20*yeetstr),vel.Z*(20*yeetstr))
- remote:FireServer("unanchor",{currentpartL,Vector3.new(velL.X*(20*yeetstr),velL.Y*(20*yeetstr),velL.Z*(20*yeetstr))})
- velL = Vector3.new(0,0,0)
- currentpartL = nil
- currentcfL = nil
- elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 6 then
- lastpart = nil
- drawing = false
- update()
- elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 8 then
- remote:FireServer("DropL")
- npL = false
- elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 8 then
- remote:FireServer("DropR")
- npR = false
- end
- end)
- function chat(mod,msg)
- wait(.2)
- updatechat(mod.Name..": "..msg)
- local bap = mod.Head:FindFirstChild('bap')
- if bap ~= nil then
- local textlabel = mod.Head.bap.TextLabel
- textlabel.Text = msg
- coroutine.resume(coroutine.create(function()
- wait(8)
- if textlabel.Text == msg then
- textlabel.Text = ""
- end
- end))
- else
- coroutine.resume(coroutine.create(function()
- local bill = Instance.new("BillboardGui",mod.Head)
- bill.Name = "bap"
- bill.LightInfluence = 0
- bill.Size = UDim2.new(10,0,4,0)
- bill.StudsOffset = Vector3.new(0,2,0)
- local textlabel = Instance.new("TextLabel",bill)
- textlabel.Size = UDim2.new(1,0,1,0)
- textlabel.BackgroundTransparency = 1
- textlabel.TextColor3 = Color3.fromRGB(255,255,255)
- textlabel.TextStrokeColor3 = Color3.fromRGB(0,0,0)
- textlabel.TextStrokeTransparency = 0
- textlabel.Text = msg
- coroutine.resume(coroutine.create(function()
- wait(8)
- if textlabel.Text == msg then
- textlabel.Text = ""
- end
- end))
- end))
- end
- end
- for i,v in pairs(game.Players:GetChildren()) do
- coroutine.resume(coroutine.create(function()
- v.Chatted:Connect(function(msg)
- chat(v.Character,msg)
- end)
- local bill = Instance.new("BillboardGui",v.Character.Head)
- bill.Name = "bap"
- bill.LightInfluence = 0
- bill.Size = UDim2.new(10,0,4,0)
- bill.StudsOffset = Vector3.new(0,2,0)
- local textlabel = Instance.new("TextLabel",bill)
- textlabel.Size = UDim2.new(1,0,1,0)
- textlabel.BackgroundTransparency = 1
- textlabel.TextColor3 = Color3.fromRGB(255,255,255)
- textlabel.TextStrokeColor3 = Color3.fromRGB(0,0,0)
- textlabel.TextStrokeTransparency = 0
- textlabel.Text = ""
- end))
- end
- game.Players.PlayerAdded:Connect(function(plr)
- coroutine.resume(coroutine.create(function()
- plr.Chatted:Connect(function(msg)
- chat(plr.Character,msg)
- end)
- local bill = Instance.new("BillboardGui",plr.Character.Head)
- bill.Name = "bap"
- bill.LightInfluence = 0
- bill.Size = UDim2.new(10,0,4,0)
- bill.StudsOffset = Vector3.new(0,2,0)
- local textlabel = Instance.new("TextLabel",bill)
- textlabel.Size = UDim2.new(1,0,1,0)
- textlabel.BackgroundTransparency = 1
- textlabel.TextColor3 = Color3.fromRGB(255,255,255)
- textlabel.TextStrokeColor3 = Color3.fromRGB(0,0,0)
- textlabel.TextStrokeTransparency = 0
- textlabel.Text = ""
- end))
- end)
- coroutine.resume(coroutine.create(function()
- game:GetService("RunService").RenderStepped:connect(function()
- Partt.CFrame = (lh.CFrame * CFrame.new(0,-0.25*size,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-90),0,0)
- Partt.Size = Vector3.new(0.668*size, 0.77*size, 0.05*size)
- local plr = game.Players.LocalPlayer
- --righthand
- local ray = Ray.new(rh.CFrame.p,(rh.CFrame.LookVector) * 1000)
- local cf = rh.CFrame
- local part, position = workspace:FindPartOnRay(ray, plr.Character, false, true)
- local distance = ((cf.p - position)).magnitude
- laserrh.Size = Vector3.new((0.125*size)/4, (0.125*size)/4, distance)
- laserrh.CFrame = CFrame.new(cf.p, position) * CFrame.new(0, 0, -distance / 2)
- --lefthand
- local ray = Ray.new(lh.CFrame.p,(lh.CFrame.LookVector) * 1000)
- local cf = lh.CFrame
- local part, position = workspace:FindPartOnRay(ray, plr.Character, false, true)
- local distance = ((cf.p - position)).magnitude
- laserlh.Size = Vector3.new((0.125*size)/4, (0.125*size)/4, distance)
- laserlh.CFrame = CFrame.new(cf.p, position) * CFrame.new(0, 0, -distance / 2)
- if laserrh.Transparency == 1 and laserlh.Transparency == 1 then
- wait(.5)
- end
- end)
- end))
- coroutine.resume(coroutine.create(function()
- game:GetService("RunService").RenderStepped:connect(function()
- if npL == true then
- remote:FireServer("UpdateL")
- end
- if npR == true then
- remote:FireServer("UpdateR")
- end
- if currentpartL ~= nil and currentcfL ~= nil then
- currentpartL.CFrame = lh.CFrame * currentcfL
- remote:FireServer("updateLL",{currentpartL,currentpartL.CFrame})
- velL = Vector3.new(currentpartL.Position.X-lastposL.X,currentpartL.Position.Y-lastposL.Y,currentpartL.Position.Z-lastposL.Z)
- lastposL = currentpartL.Position
- end
- if currentpartR ~= nil and currentcfR ~= nil then
- currentpartR.CFrame = rh.CFrame * currentcfR
- remote:FireServer("updateRR",{currentpartR,currentpartR.CFrame})
- velR = Vector3.new(currentpartR.Position.X-lastposR.X,currentpartR.Position.Y-lastposR.Y,currentpartR.Position.Z-lastposR.Z)
- lastposR = currentpartR.Position
- end
- end)
- end))
- coroutine.resume(coroutine.create(function()
- game:GetService("RunService").RenderStepped:Connect(function()
- if drawing and (folder ~= nil and folder.Parent ~= nil) then
- if lastpart == nil then
- lastpart = (rh.CFrame * CFrame.new(0,0,-0.8*size)).p
- else
- local pos1 = lastpart
- local pos2 = (rh.CFrame * CFrame.new(0,0,-0.8*size)).p
- local pos3 = Vector3.new(math.abs(pos1.X-pos2.X),math.abs(pos1.Y-pos2.Y),math.abs(pos1.Z-pos2.Z))
- if pos3.X + pos3.Y + pos3.Z >= distance*1.35 then
- if lastline ~= nil then
- lastline:Destroy()
- end
- local lastpar = pos2
- drawLine(lastpart,lastpar)
- lastpart = lastpar
- else
- if lastline ~= nil then
- lastline:Destroy()
- end
- if lastpart2 == nil then
- lastpart2 = pos2
- else
- lastpart2 = pos2
- end
- lastline = drawLine(lastpart,lastpart2)
- end
- end
- elseif drawing and (folder == nil or folder.Parent == nil) then
- folder = Instance.new("Folder",workspace)
- folder.Name = "DrawStuff"
- else
- lastpart2 = nil
- lastline = nil
- end
- end)
- end))
- while wait(1) do
- if selec1.Adornee == nil then
- coroutine.resume(coroutine.create(function()
- wait(1)
- workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-Head").Transparency = 1
- selec1.Adornee = workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-LeftHand")
- selec2.Adornee = workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand")
- workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-LeftHand").Transparency = 1
- workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand").Transparency = 1
- end))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement