BobMe

localvr - void 2

Jun 8th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.41 KB | None | 0 0
  1. wait(2)
  2. print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
  3. local size = 5
  4.  
  5. -- don't mind my messy, unorganized code, just focus on the beauty of the script!
  6. local VRService = game:GetService("VRService")
  7. local RunService = game:GetService("RunService")
  8. local lh = Instance.new("Part",workspace)
  9. local mode = 0
  10. lastmode = 0
  11. local maxmodes = 5
  12.  
  13. while workspace:FindFirstChild("dksfbfkhsdhbfsjhd") ~= nil do
  14. workspace:FindFirstChild("dksfbfkhsdhbfsjhd"):Destroy()
  15. end
  16.  
  17. lh.Transparency = 0
  18. lh.Size = Vector3.new(0.2,0.2,0.6) * Vector3.new(size,size,size)
  19. lh.Material = "Metal"
  20. lh.Color = Color3.fromRGB(255,100,255)
  21. lh.Name = "dksfbfkhsdhbfsjhd"
  22. lh.CanCollide = false
  23. lh.Anchored = true
  24. local rh = Instance.new("Part",workspace)
  25. rh.Transparency = 0
  26. rh.Size = Vector3.new(0.2,0.2,0.6) * Vector3.new(size,size,size)
  27. rh.Material = "Metal"
  28. rh.Name = "dksfbfkhsdhbfsjhd"
  29. rh.Color = Color3.fromRGB(255,100,255)
  30. rh.CanCollide = false
  31. rh.Anchored = true
  32. local selec1 = Instance.new("SelectionBox",lh)
  33. selec1.Color3 = Color3.fromRGB(255,0,255)
  34. selec1.LineThickness = 0.15
  35. local selec2 = Instance.new("SelectionBox",rh)
  36. selec2.Color3 = Color3.fromRGB(255,0,255)
  37. selec2.LineThickness = 0.15
  38. local he = Instance.new("Part",workspace)
  39. he.Size = Vector3.new(2,2,2) * Vector3.new(size,size,size)
  40. he.CanCollide = false
  41. he.Transparency = 1
  42. he.Anchored = true
  43. local antispamright = false
  44. local antispamleft = false
  45.  
  46. local laserrh = Instance.new("Part")
  47. laserrh.Color = Color3.fromRGB(255, 75, 230)
  48. laserrh.Name = "dksfbfkhsdhbfsjhd"
  49. laserrh.Material = "Neon"
  50. laserrh.Transparency = 1
  51. laserrh.Parent = workspace
  52. laserrh.CanCollide = false
  53. laserrh.Anchored = true
  54. local laserlh = Instance.new("Part")
  55. laserlh.Color = Color3.fromRGB(255, 75, 230)
  56. laserlh.Material = "Neon"
  57. laserlh.Transparency = 1
  58. laserlh.Name = "dksfbfkhsdhbfsjhd"
  59. laserlh.Parent = workspace
  60. laserlh.CanCollide = false
  61. laserlh.Anchored = true
  62.  
  63. game.StarterGui:SetCore("VRLaserPointerMode", 0)
  64. game.StarterGui:SetCore("VREnableControllerModels", false)
  65.  
  66. --now to wait for the server if it isn't called yet!
  67. local remote = game.Players.LocalPlayer:WaitForChild("VrC")
  68. remote:FireServer("Start",size)
  69. wait(.5)
  70. workspace:WaitForChild(game.Players.LocalPlayer.Name.."-Head").Transparency = 1
  71. selec1.Adornee = workspace:WaitForChild(game.Players.LocalPlayer.Name.."-LeftHand")
  72. selec2.Adornee = workspace:WaitForChild(game.Players.LocalPlayer.Name.."-RightHand")
  73. workspace:WaitForChild(game.Players.LocalPlayer.Name.."-LeftHand").Transparency = 1
  74. workspace:WaitForChild(game.Players.LocalPlayer.Name.."-RightHand").Transparency = 1
  75.  
  76. local function multiplyCFrame(a, b)
  77. local ax, ay, az, a11, a12, a13, a21, a22, a23, a31, a32, a33 = a:components()
  78. local bx, by, bz, b11, b12, b13, b21, b22, b23, b31, b32, b33 = b:components()
  79. local x = ax*bx
  80. local y = ay*by
  81. local z = az*bz
  82. local m11 = a11*b11
  83. local m12 = a12*b12
  84. local m13 = a13*b13
  85. local m21 = a21*b21
  86. local m22 = a22*b22
  87. local m23 = a23*b23
  88. local m31 = a31*b31
  89. local m32 = a32*b32
  90. local m33 = a33*b33
  91. return CFrame.new(x, y, z, m11, m12, m13, m21, m22, m23, m31, m32, m33)
  92. end
  93. workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
  94. workspace.CurrentCamera.CFrame = CFrame.new(0,0,0) * CFrame.new(0,5*size,0)
  95. workspace.CurrentCamera.HeadScale = size
  96.  
  97. RunService.RenderStepped:Connect(function()
  98. workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
  99. local curr = workspace.CurrentCamera.CFrame
  100. local head = (VRService:GetUserCFrame(Enum.UserCFrame.Head) * CFrame.new(0,0,0.2)) + Vector3.new(0,1.25*(4*(1-size)),0)
  101. he.CFrame = multiplyCFrame((curr * head),CFrame.new(size, size, size, 1, 1, 1, 1, 1, 1, 1, 1, 1))
  102. local lefthand = (VRService:GetUserCFrame(Enum.UserCFrame.LeftHand) * CFrame.new(0,0,0.2)) + Vector3.new(0,1.25*(4*(1-size)),0)
  103. lh.CFrame = multiplyCFrame((curr * lefthand),CFrame.new(size, size, size, 1, 1, 1, 1, 1, 1, 1, 1, 1))
  104. local righthand = (VRService:GetUserCFrame(Enum.UserCFrame.RightHand) * CFrame.new(0,0,0.2)) + Vector3.new(0,1.25*(4*(1-size)),0)
  105. rh.CFrame = multiplyCFrame((curr * righthand),CFrame.new(size, size, size, 1, 1, 1, 1, 1, 1, 1, 1, 1))
  106. lh.Size = Vector3.new(0.2,0.2,0.6) * Vector3.new(size,size,size)
  107. rh.Size = Vector3.new(0.2,0.2,0.6) * Vector3.new(size,size,size)
  108. he.Size = Vector3.new(2,2,2) * Vector3.new(size,size,size)
  109. remote:FireServer("update",{lh.CFrame,rh.CFrame,he.CFrame,size})
  110. end)
  111.  
  112. function changeMode()
  113. if mode == 0 then
  114. lh.Color = Color3.fromRGB(255,100,255)
  115. rh.Color = Color3.fromRGB(255,100,255)
  116. selec1.Color3 = Color3.fromRGB(255,0,255)
  117. selec2.Color3 = Color3.fromRGB(255,0,255)
  118. laserlh.Color = Color3.fromRGB(255, 75, 230)
  119. laserrh.Color = Color3.fromRGB(255, 75, 230)
  120. elseif mode == 1 then
  121. lh.Color = Color3.fromRGB(100,100,255)
  122. rh.Color = Color3.fromRGB(100,100,255)
  123. selec1.Color3 = Color3.fromRGB(0,0,255)
  124. selec2.Color3 = Color3.fromRGB(0,0,255)
  125. elseif mode == 2 then
  126. lh.Color = Color3.fromRGB(255,100,100)
  127. rh.Color = Color3.fromRGB(255,100,100)
  128. selec1.Color3 = Color3.fromRGB(255,0,0)
  129. selec2.Color3 = Color3.fromRGB(255,0,0)
  130. elseif mode == 3 then
  131. lh.Color = Color3.fromRGB(100,255,100)
  132. rh.Color = Color3.fromRGB(100,255,100)
  133. selec1.Color3 = Color3.fromRGB(0,255,0)
  134. selec2.Color3 = Color3.fromRGB(0,255,0)
  135. laserlh.Color = Color3.fromRGB(100,255,100)
  136. laserrh.Color = Color3.fromRGB(100,255,100)
  137. laserlh.Transparency = 0.875
  138. laserrh.Transparency = 0.875
  139. elseif mode == 4 then
  140. lh.Color = Color3.fromRGB(255,255,100)
  141. rh.Color = Color3.fromRGB(255,255,100)
  142. selec1.Color3 = Color3.fromRGB(255,255,0)
  143. selec2.Color3 = Color3.fromRGB(255,255,0)
  144. elseif mode == 5 then
  145. lh.Color = Color3.fromRGB(100,255,255)
  146. rh.Color = Color3.fromRGB(100,255,255)
  147. lh.Transparency = 0.5
  148. rh.Transparency = 0.5
  149. selec1.Color3 = Color3.fromRGB(0,255,255)
  150. selec2.Color3 = Color3.fromRGB(0,255,255)
  151. end
  152. if mode ~= 3 then
  153. laserlh.Transparency = 1
  154. laserrh.Transparency = 1
  155. end
  156. if lastmode == 5 then
  157. coroutine.resume(coroutine.create(function()
  158. lh.Transparency = 0
  159. rh.Transparency = 0
  160. wait(1)
  161. workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-LeftHand").Transparency = 1
  162. workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand").Transparency = 1
  163. workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-Head").Transparency = 1
  164. end))
  165. end
  166. remote:FireServer("mode",mode)
  167. lastmode = mode
  168. end
  169.  
  170. VRService:SetTouchpadMode(Enum.VRTouchpad.Right, Enum.VRTouchpadMode.ABXY)
  171. local UserInputService = game:GetService("UserInputService")
  172. UserInputService.InputBegan:Connect(function(input, gameProcessed)
  173. if input.KeyCode == Enum.KeyCode.ButtonY then
  174. if size >= 1 then
  175. size = size + 1
  176. elseif size >= 10 then
  177. size = size + 2
  178. elseif size >= 50 then
  179. size = size + 5
  180. elseif size >= 200 then
  181. size = size + 20
  182. elseif size < 1 then
  183. size = size * 2
  184. end
  185. workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
  186. local bon = workspace.CurrentCamera.CFrame
  187. workspace.CurrentCamera.CFrame = CFrame.new(bon.X*-1,0,bon.Z*-1) * CFrame.new(0,5*size,0)
  188. workspace.CurrentCamera.HeadScale = size
  189. elseif input.KeyCode == Enum.KeyCode.ButtonA then
  190. if size <= 1 then
  191. size = size / 2
  192. elseif size <= 10 then
  193. size = size - 1
  194. elseif size > 10 then
  195. size = size - 2
  196. end
  197. workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
  198. local bon = workspace.CurrentCamera.CFrame
  199. workspace.CurrentCamera.CFrame = CFrame.new(bon.X*-1,0,bon.Z*-1) * CFrame.new(0,5*size,0)
  200. workspace.CurrentCamera.HeadScale = size
  201. elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 0 then
  202. if antispamright == false then
  203. laserrh.Transparency = 0.875
  204. local csc = remote:FireServer("chargeright")
  205. antispamright = true
  206. end
  207. elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 0 then
  208. if antispamleft == false then
  209. laserlh.Transparency = 0.875
  210. local csc = remote:FireServer("chargeleft")
  211. antispamleft = true
  212. end
  213. elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 3 then
  214. if false == false then
  215. local csc = remote
  216. local plr = game.Players.LocalPlayer
  217. local ray = Ray.new(rh.CFrame.p,(rh.CFrame.LookVector) * 1000)
  218. print(tostring(workspace:FindPartOnRayWithIgnoreList(ray, {rh,workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand")})))
  219. csc:FireServer("GrabRight",{workspace:FindPartOnRayWithIgnoreList(ray, {rh,laserrh,laserlh,workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand")})})
  220. end
  221. elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 3 then
  222. if false == false then
  223. local csc = remote
  224. local plr = game.Players.LocalPlayer
  225. local ray = Ray.new(lh.CFrame.p,(lh.CFrame.LookVector) * 1000)
  226. csc:FireServer("GrabLeft",{workspace:FindPartOnRayWithIgnoreList(ray, {lh,laserrh,laserlh,workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-LeftHand")})})
  227. end
  228. elseif input.KeyCode == Enum.KeyCode.ButtonL1 then
  229. if antispamleft == false and antispamright == false then
  230. --grip left
  231. mode = mode - 1
  232. if mode < 0 then
  233. mode = maxmodes
  234. end
  235. changeMode()
  236. end
  237. elseif input.KeyCode == Enum.KeyCode.ButtonR1 then
  238. if antispamleft == false and antispamright == false then
  239. --grip left
  240. mode = mode + 1
  241. if mode > maxmodes then
  242. mode = 0
  243. end
  244. changeMode()
  245. end
  246. end
  247. if size <= 2 then
  248. selec1.LineThickness = 0.15/8
  249. selec2.LineThickness = 0.15/8
  250. else
  251. selec1.LineThickness = 0.15
  252. selec2.LineThickness = 0.15
  253. end
  254. end)
  255.  
  256. UserInputService.InputEnded:Connect(function(input, gameProcessed)
  257. if input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 0 then
  258. if antispamright == true then
  259. local csc = remote
  260. local plr = game.Players.LocalPlayer
  261. local tool = script.Parent
  262. local ray = Ray.new(rh.CFrame.p,(rh.CFrame.LookVector*Vector3.new(-1,-1,-1)) * 1000)
  263. csc:FireServer("ShootRight",{ray,rh.CFrame})
  264. laserrh.Transparency = 1
  265. antispamright = false
  266. end
  267. elseif input.KeyCode == Enum.KeyCode.ButtonR2 and mode == 3 then
  268. remote:FireServer("UngrabRight")
  269. elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 3 then
  270. remote:FireServer("UngrabLeft")
  271. elseif input.KeyCode == Enum.KeyCode.ButtonL2 and mode == 0 then
  272. if antispamleft == true then
  273. local csc = remote
  274. local plr = game.Players.LocalPlayer
  275. local tool = script.Parent
  276. local ray = Ray.new(rh.CFrame.p,(rh.CFrame.LookVector*Vector3.new(-1,-1,-1)) * 1000)
  277. csc:FireServer("ShootLeft",{ray,lh.CFrame})
  278. laserlh.Transparency = 1
  279. antispamleft = false
  280. end
  281. end
  282. end)
  283.  
  284. function chat(mod,msg)
  285. wait(.2)
  286. local bap = mod.Head:FindFirstChild('bap')
  287. if bap ~= nil then
  288. local textlabel = mod.Head.bap.TextLabel
  289. textlabel.Text = msg
  290. coroutine.resume(coroutine.create(function()
  291. wait(8)
  292. if textlabel.Text == msg then
  293. textlabel.Text = ""
  294. end
  295. end))
  296. else
  297. coroutine.resume(coroutine.create(function()
  298. local bill = Instance.new("BillboardGui",mod.Head)
  299. bill.Name = "bap"
  300. bill.LightInfluence = 0
  301. bill.Size = UDim2.new(10,0,4,0)
  302. bill.StudsOffset = Vector3.new(0,2,0)
  303. local textlabel = Instance.new("TextLabel",bill)
  304. textlabel.Size = UDim2.new(1,0,1,0)
  305. textlabel.BackgroundTransparency = 1
  306. textlabel.TextColor3 = Color3.fromRGB(255,255,255)
  307. textlabel.TextStrokeColor3 = Color3.fromRGB(0,0,0)
  308. textlabel.TextStrokeTransparency = 0
  309. textlabel.Text = msg
  310. coroutine.resume(coroutine.create(function()
  311. wait(8)
  312. if textlabel.Text == msg then
  313. textlabel.Text = ""
  314. end
  315. end))
  316. end))
  317. end
  318. end
  319. for i,v in pairs(game.Players:GetChildren()) do
  320. coroutine.resume(coroutine.create(function()
  321. v.Chatted:Connect(function(msg)
  322. chat(v.Character,msg)
  323. end)
  324. local bill = Instance.new("BillboardGui",v.Character.Head)
  325. bill.Name = "bap"
  326. bill.LightInfluence = 0
  327. bill.Size = UDim2.new(10,0,4,0)
  328. bill.StudsOffset = Vector3.new(0,2,0)
  329. local textlabel = Instance.new("TextLabel",bill)
  330. textlabel.Size = UDim2.new(1,0,1,0)
  331. textlabel.BackgroundTransparency = 1
  332. textlabel.TextColor3 = Color3.fromRGB(255,255,255)
  333. textlabel.TextStrokeColor3 = Color3.fromRGB(0,0,0)
  334. textlabel.TextStrokeTransparency = 0
  335. textlabel.Text = ""
  336. end))
  337. end
  338. game.Players.PlayerAdded:Connect(function(plr)
  339. coroutine.resume(coroutine.create(function()
  340. plr.Chatted:Connect(function(msg)
  341. chat(plr.Character,msg)
  342. end)
  343. local bill = Instance.new("BillboardGui",plr.Character.Head)
  344. bill.Name = "bap"
  345. bill.LightInfluence = 0
  346. bill.Size = UDim2.new(10,0,4,0)
  347. bill.StudsOffset = Vector3.new(0,2,0)
  348. local textlabel = Instance.new("TextLabel",bill)
  349. textlabel.Size = UDim2.new(1,0,1,0)
  350. textlabel.BackgroundTransparency = 1
  351. textlabel.TextColor3 = Color3.fromRGB(255,255,255)
  352. textlabel.TextStrokeColor3 = Color3.fromRGB(0,0,0)
  353. textlabel.TextStrokeTransparency = 0
  354. textlabel.Text = ""
  355. end))
  356. end)
  357.  
  358. coroutine.resume(coroutine.create(function()
  359. game:GetService("RunService").RenderStepped:connect(function()
  360. local plr = game.Players.LocalPlayer
  361. --righthand
  362. local ray = Ray.new(rh.CFrame.p,(rh.CFrame.LookVector) * 1000)
  363. local cf = rh.CFrame
  364. local part, position = workspace:FindPartOnRay(ray, plr.Character, false, true)
  365. local distance = ((cf.p - position)).magnitude
  366. laserrh.Size = Vector3.new((0.125*size)/4, (0.125*size)/4, distance)
  367. laserrh.CFrame = CFrame.new(cf.p, position) * CFrame.new(0, 0, -distance / 2)
  368. --lefthand
  369. local ray = Ray.new(lh.CFrame.p,(lh.CFrame.LookVector) * 1000)
  370. local cf = lh.CFrame
  371. local part, position = workspace:FindPartOnRay(ray, plr.Character, false, true)
  372. local distance = ((cf.p - position)).magnitude
  373. laserlh.Size = Vector3.new((0.125*size)/4, (0.125*size)/4, distance)
  374. laserlh.CFrame = CFrame.new(cf.p, position) * CFrame.new(0, 0, -distance / 2)
  375. if laserrh.Transparency == 1 and laserlh.Transparency == 1 then
  376. wait(.5)
  377. end
  378. end)
  379. end))
  380.  
  381. while wait(1) do
  382. if selec1.Adornee == nil then
  383. coroutine.resume(coroutine.create(function()
  384. wait(1)
  385. workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-Head").Transparency = 1
  386. selec1.Adornee = workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-LeftHand")
  387. selec2.Adornee = workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand")
  388. workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-LeftHand").Transparency = 1
  389. workspace:FindFirstChild(game.Players.LocalPlayer.Name.."-RightHand").Transparency = 1
  390. end))
  391. end
  392. end
Add Comment
Please, Sign In to add comment