Advertisement
Guest User

Volleyball 4.2 Script by Sneaky

a guest
Jun 21st, 2022
918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.29 KB | None | 0 0
  1. local dev = true
  2. local Volleyball42 = Instance.new("ScreenGui")
  3. local Main = Instance.new("Frame")
  4. local UICorner = Instance.new("UICorner")
  5. local TextLabel = Instance.new("TextLabel")
  6. local Setting = Instance.new("TextButton")
  7. local Serving = Instance.new("TextButton")
  8. local Receives = Instance.new("TextButton")
  9. local Power = Instance.new("TextButton")
  10. local Block = Instance.new("TextButton")
  11. local Destroy = Instance.new("TextButton")
  12.  
  13. Volleyball42.Name = "Volleyball42"
  14. Volleyball42.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  15. Volleyball42.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  16.  
  17. Main.Name = "Main"
  18. Main.Parent = Volleyball42
  19. Main.BackgroundColor3 = Color3.fromRGB(104, 104, 104)
  20. Main.Position = UDim2.new(0.428033143, 0, 0.309200615, 0)
  21. Main.Size = UDim2.new(0, 283, 0, 159)
  22. Main.Active = true
  23. Main.Draggable = true
  24.  
  25. UICorner.Parent = Main
  26.  
  27. TextLabel.Parent = Main
  28. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  29. TextLabel.BackgroundTransparency = 1.000
  30. TextLabel.Size = UDim2.new(0, 283, 0, 26)
  31. TextLabel.Font = Enum.Font.Oswald
  32. TextLabel.Text = "Volleyball 4.2 by Sneaky"
  33. TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  34. TextLabel.TextScaled = true
  35. TextLabel.TextSize = 14.000
  36. TextLabel.TextWrapped = true
  37.  
  38. Setting.Name = "Setting"
  39. Setting.Parent = Main
  40. Setting.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  41. Setting.BackgroundTransparency = 0.400
  42. Setting.Position = UDim2.new(0.0494699515, 0, 0.207547188, 0)
  43. Setting.Size = UDim2.new(0, 121, 0, 34)
  44. Setting.Font = Enum.Font.SourceSans
  45. Setting.Text = "Setting"
  46. Setting.TextColor3 = Color3.fromRGB(255, 255, 255)
  47. Setting.TextScaled = true
  48. Setting.TextSize = 14.000
  49. Setting.TextWrapped = true
  50.  
  51. Serving.Name = "Serving"
  52. Serving.Parent = Main
  53. Serving.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  54. Serving.BackgroundTransparency = 0.400
  55. Serving.Position = UDim2.new(0.0494699515, 0, 0.465408802, 0)
  56. Serving.Size = UDim2.new(0, 121, 0, 34)
  57. Serving.Font = Enum.Font.SourceSans
  58. Serving.Text = "Serving"
  59. Serving.TextColor3 = Color3.fromRGB(255, 255, 255)
  60. Serving.TextScaled = true
  61. Serving.TextSize = 14.000
  62. Serving.TextWrapped = true
  63.  
  64. Receives.Name = "Spiking"
  65. Receives.Parent = Main
  66. Receives.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  67. Receives.BackgroundTransparency = 0.400
  68. Receives.Position = UDim2.new(0.0494699515, 0, 0.729559779, 0)
  69. Receives.Size = UDim2.new(0, 121, 0, 34)
  70. Receives.Font = Enum.Font.SourceSans
  71. Receives.Text = "Spiking"
  72. Receives.TextColor3 = Color3.fromRGB(255, 255, 255)
  73. Receives.TextScaled = true
  74. Receives.TextSize = 14.000
  75. Receives.TextWrapped = true
  76.  
  77. Power.Name = "Power"
  78. Power.Parent = Main
  79. Power.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  80. Power.BackgroundTransparency = 0.400
  81. Power.Position = UDim2.new(0.526501775, 0, 0.207547188, 0)
  82. Power.Size = UDim2.new(0, 121, 0, 34)
  83. Power.Font = Enum.Font.SourceSans
  84. Power.Text = "Power"
  85. Power.TextColor3 = Color3.fromRGB(255, 255, 255)
  86. Power.TextScaled = true
  87. Power.TextSize = 14.000
  88. Power.TextWrapped = true
  89.  
  90. Block.Name = "Sprint"
  91. Block.Parent = Main
  92. Block.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  93. Block.BackgroundTransparency = 0.400
  94. Block.Position = UDim2.new(0.526501775, 0, 0.465408802, 0)
  95. Block.Size = UDim2.new(0, 121, 0, 34)
  96. Block.Font = Enum.Font.SourceSans
  97. Block.Text = "Sprint"
  98. Block.TextColor3 = Color3.fromRGB(255, 255, 255)
  99. Block.TextScaled = true
  100. Block.TextSize = 14.000
  101. Block.TextWrapped = true
  102.  
  103. Destroy.Name = "Destroy"
  104. Destroy.Parent = Main
  105. Destroy.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  106. Destroy.BackgroundTransparency = 0.400
  107. Destroy.Position = UDim2.new(0.526501775, 0, 0.729559779, 0)
  108. Destroy.Size = UDim2.new(0, 121, 0, 34)
  109. Destroy.Font = Enum.Font.SourceSans
  110. Destroy.Text = "Destroy"
  111. Destroy.TextColor3 = Color3.fromRGB(170, 0, 0)
  112. Destroy.TextScaled = true
  113. Destroy.TextSize = 14.000
  114. Destroy.TextWrapped = true
  115.  
  116. local UserInputService = game:GetService("UserInputService")
  117. local player = game.Players.LocalPlayer
  118. local setting
  119. local serving
  120. local spiking
  121. local power
  122. local block
  123. local sprint
  124.  
  125. for i, v in pairs(workspace:GetChildren()) do
  126. if v:IsA("Part") and not v:IsA("Camera") and v.Transparency == 1 and not v.Name == "Net" then
  127. v:Destroy()
  128. end
  129. end
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. if dev then print(1) end
  137.  
  138. local ui = player:WaitForChild("PlayerGui"):WaitForChild("Volleyball42")
  139.  
  140. local function lookAt(chr,target)
  141. if chr.PrimaryPart then
  142. local frame = CFrame.new(chr.PrimaryPart.Position, target.Position)
  143. chr:SetPrimaryPartCFrame(frame)
  144. end
  145. end
  146.  
  147. local function lookAway(chr,target)
  148. if chr.PrimaryPart then
  149. local frame = CFrame.new(chr.PrimaryPart.Position, target.Position)
  150. chr:SetPrimaryPartCFrame(frame)
  151. chr.HumanoidRootPart.CFrame *= CFrame.Angles(0, math.rad(180), 0)
  152. end
  153. end
  154.  
  155. local mouse = game.Players.LocalPlayer:GetMouse()
  156.  
  157. game.Players.LocalPlayer.CharacterAdded:connect(
  158. function(char)
  159. mouse.TargetFilter = char
  160. end
  161. )
  162.  
  163. for i, v in pairs(ui.Main:GetChildren()) do
  164. if v:IsA("TextButton") then
  165. v.Activated:Connect(function()
  166.  
  167. -- Destroy
  168. if v.Name == "Destroy" then
  169. if debug then print("Destroy") end
  170. ui:Destroy()
  171. end
  172.  
  173. -- Setting
  174. if v.Name == "Setting" then
  175. if debug then print("Setting") end
  176. if setting then
  177.  
  178. for i, v in pairs(workspace:GetChildren()) do
  179. if v.Name == "Left" or v.Name == "Right" then
  180. v:Destroy()
  181. end
  182. end
  183. ui:WaitForChild("Main").Setting.TextColor = BrickColor.new("White")
  184. setting = false
  185. return
  186. end
  187. ui:WaitForChild("Main").Setting.TextColor = BrickColor.new("Bright green")
  188. left = Instance.new("Part")
  189. right = Instance.new("Part")
  190. left.Name = "Left"
  191. right.Name = "Right"
  192. left.Position = Vector3.new(-23.789, 8, 0.007)
  193. right.Position = Vector3.new(23.783, 8, -0.006)
  194. left.Size = Vector3.new(1.607, 1, 2)
  195. right.Size = Vector3.new(1.607, 1, 2)
  196. left.CanCollide = false
  197. right.CanCollide = false
  198. left.Anchored = true
  199. right.Anchored = true
  200. left.Parent = workspace
  201. right.Parent = workspace
  202.  
  203. setting = true
  204. end
  205.  
  206. -- Serving
  207. if v.Name == "Serving" then
  208. if debug then print("Serving") end
  209. if serving then
  210.  
  211. for i, v in pairs(workspace:GetChildren()) do
  212. if v.Name == "RedRight" or v.Name == "RedLeft" then
  213. v:Destroy()
  214. end
  215. end
  216.  
  217. ui:WaitForChild("Main").Serving.TextColor = BrickColor.new("White")
  218. serving = false
  219. else
  220. redRCorner = Instance.new("Part")
  221. redLCorner = Instance.new("Part")
  222. bluRCorner = Instance.new("Part")
  223. bluLCorner = Instance.new("Part")
  224. redRCorner.Name = "RedRight"
  225. redLCorner.Name = "RedLeft"
  226. bluRCorner.Name = "RedRight"
  227. bluLCorner.Name = "RedLeft"
  228. redRCorner.Position = Vector3.new(23.479, 0.638, -47.059)
  229. redLCorner.Position = Vector3.new(-23.577, 0.633, -47.059)
  230. bluRCorner.Position = Vector3.new(-23.577, 0.633, 46.936)
  231. bluLCorner.Position = Vector3.new(23.483, 0.628, 46.936)
  232. redRCorner.Size = Vector3.new(1.048, 0.076, 1.07)
  233. redLCorner.Size = Vector3.new(1.048, 0.076, 1.07)
  234. bluRCorner.Size = Vector3.new(1.048, 0.076, 1.07)
  235. bluLCorner.Size = Vector3.new(1.048, 0.076, 1.07)
  236. redRCorner.Anchored = true
  237. redLCorner.Anchored = true
  238. bluRCorner.Anchored = true
  239. bluLCorner.Anchored = true
  240. redRCorner.CanCollide = false
  241. redLCorner.CanCollide = false
  242. bluRCorner.CanCollide = false
  243. bluRCorner.CanCollide = false
  244. redRCorner.Parent = workspace
  245. redLCorner.Parent = workspace
  246. bluRCorner.Parent = workspace
  247. bluLCorner.Parent = workspace
  248.  
  249. ui:WaitForChild("Main").Serving.TextColor = BrickColor.new("Bright green")
  250. serving = true
  251. end
  252. end
  253.  
  254. -- Spiking
  255. if v.Name == "Spiking" then
  256. if debug then print("Spiking") end
  257. if spiking then
  258.  
  259. for i, v in pairs(workspace:GetChildren()) do
  260. if v.Name == "RedSpike" or v.Name == "bluSpike" then
  261. v:Destroy()
  262. end
  263. end
  264.  
  265.  
  266. ui:WaitForChild("Main").Spiking.TextColor = BrickColor.new("White")
  267. spiking = false
  268. else
  269. redSpike = Instance.new("Part")
  270. redSpike.Name = "RedSpike"
  271. redSpike.Anchored = true
  272. redSpike.CanCollide = false
  273. redSpike.Position = Vector3.new(-0.009, 0.501, -23.927)
  274. redSpike.Size = Vector3.new(47.936, 0.001, 46.988)
  275. redSpike.Transparency = 1
  276. redSpike.Parent = workspace
  277. bluSpike = Instance.new("Part")
  278. bluSpike.Name = "RedSpike"
  279. bluSpike.Anchored = true
  280. bluSpike.CanCollide = false
  281. bluSpike.Position = Vector3.new(-0.009, 0.501, 23.984)
  282. bluSpike.Size = Vector3.new(47.936, 0.001, 46.988)
  283. bluSpike.Transparency = 1
  284. bluSpike.Parent = workspace
  285.  
  286.  
  287. ui:WaitForChild("Main").Spiking.TextColor = BrickColor.new("Bright green")
  288. spiking = true
  289. end
  290. end
  291.  
  292. -- Power
  293. if v.Name == "Power" then
  294. if power then
  295. ui:WaitForChild("Main").Power.TextColor = BrickColor.new("White")
  296. power = false
  297. else
  298. ui:WaitForChild("Main").Power.TextColor = BrickColor.new("Bright green")
  299. power = true
  300. end
  301. end
  302.  
  303. -- Sprint
  304. if v.Name == "Sprint" then
  305. if dev then print("Sprint") end
  306. if sprint then
  307. ui:WaitForChild("Main").Sprint.TextColor = BrickColor.new("White")
  308. sprint = false
  309. else
  310. ui:WaitForChild("Main").Sprint.TextColor = BrickColor.new("Bright green")
  311. sprint = true
  312. end
  313. end
  314.  
  315. end)
  316. end
  317. end
  318.  
  319.  
  320. -- inputs
  321. if dev then print("setting uis to be done") end
  322. UserInputService.InputBegan:Connect(function(input, event)
  323.  
  324. if input.KeyCode == Enum.KeyCode[jump] and power then
  325. local N=game:GetService("VirtualInputManager")
  326. N:SendKeyEvent(true,string.upper(maxPower),false,game)
  327. end
  328.  
  329.  
  330. if input.KeyCode == Enum.KeyCode[string.upper(setForward)] and setting then
  331. if player.TeamColor == BrickColor.new("Really blue") then
  332. lookAt(player.Character, left)
  333. else
  334. lookAt(player.Character, right)
  335. end
  336. end
  337.  
  338. if input.KeyCode == Enum.KeyCode[string.upper(setBackwards)] and setting then
  339. if player.TeamColor == BrickColor.new("Really red") then
  340. lookAway(player.Character, left)
  341. else
  342. lookAway(player.Character, right)
  343. end
  344. end
  345.  
  346. if input.KeyCode == Enum.KeyCode[jump] and serving then
  347. if debug then print("Jump") end
  348. if player.Character.UpperTorso.Position.Z > 40 and player.TeamColor == BrickColor.new("Really blue") then
  349.  
  350. local r = math.random(1, 2)
  351. if r == 1 then
  352. lookAt(player.Character, redRCorner)
  353. else
  354. lookAt(player.Character, redLCorner)
  355. end
  356.  
  357. elseif player.Character.UpperTorso.Position.Z < -40 and player.TeamColor == BrickColor.new("Really red") then
  358.  
  359. local r = math.random(1, 2)
  360. if r == 1 then
  361. lookAt(player.Character, bluRCorner)
  362. else
  363. lookAt(player.Character, bluLCorner)
  364. end
  365.  
  366.  
  367. else
  368. if debug then print("False") end
  369. end
  370. end
  371.  
  372. if input.KeyCode == Enum.KeyCode[jump] and spiking then
  373. if debug then print("Jump") end
  374.  
  375. if block == true then return end
  376.  
  377. if spikeMode == "random" or nil then
  378. local aimPart = Instance.new("Part")
  379. aimPart.Size = Vector3.new(0.318, 0.001, 0.472)
  380.  
  381.  
  382. if player.TeamColor == BrickColor.new("Really blue") and player.Character.UpperTorso.Position.Z < 40 then
  383.  
  384. local rP = Instance.new("Part")
  385. rP.Anchored = true
  386. rP.Transparency = 1
  387. local range = 20
  388. rP.Position = redSpike.Position + Vector3.new(math.random(-range,range),10,math.random(-range,range))
  389. rP.Parent = workspace
  390.  
  391. lookAt(player.Character, rP)
  392. rP:Destroy()
  393.  
  394. if debug then print("Random part made") end
  395. elseif player.TeamColor == BrickColor.new("Really red") and player.Character.UpperTorso.Position.Z > -40 then
  396.  
  397. local rP = Instance.new("Part")
  398. rP.Anchored = true
  399. rP.Transparency = 1
  400. local range = 20
  401. rP.Position = bluSpike.Position + Vector3.new(math.random(-range,range),10,math.random(-range,range))
  402. rP.Parent = workspace
  403.  
  404. lookAt(player.Character, rP)
  405. rP:Destroy()
  406. if debug then print("Random part made") end
  407. end
  408. end
  409.  
  410. if spikeMode == "point" then
  411.  
  412. if player.TeamColor == BrickColor.new("Really blue") and player.Character.UpperTorso.Position.Z < 40 then
  413. local p = Instance.new("Part")
  414. p.Anchored = true
  415. p.CanCollide = false
  416. p.CFrame = CFrame.new(mouse.Hit.X, 10, mouse.Hit.Z)
  417. p.Transparency = 1
  418. p.Parent = workspace
  419. lookAt(player.Character, p)
  420. elseif player.TeamColor == BrickColor.new("Really red") and player.Character.UpperTorso.Position.Z > -40 then
  421. local p = Instance.new("Part")
  422. p.Anchored = true
  423. p.CanCollide = false
  424. p.CFrame = CFrame.new(mouse.Hit.X, 10, mouse.Hit.Z)
  425. p.Transparency = 1
  426. p.Parent = workspace
  427. lookAt(player.Character, p)
  428. end
  429. end
  430. end
  431.  
  432. if input.KeyCode == Enum.KeyCode[changeMode] then
  433. if block then block = false else block = true end
  434. end
  435.  
  436. if input.KeyCode == Enum.KeyCode.W or input.KeyCode == Enum.KeyCode.A or input.KeyCode == Enum.KeyCode.S or input.KeyCode == Enum.KeyCode.D then
  437. if sprint then
  438. local N=game:GetService("VirtualInputManager")
  439. N:SendKeyEvent(true,string.upper(sprintKey),false,game)
  440. task.wait(0.1)
  441. N:SendKeyEvent(true,string.upper(sprintKey),false,game)
  442. task.wait(0.1)
  443. N:SendKeyEvent(true,string.upper(sprintKey),false,game)
  444. end
  445. end
  446.  
  447. end)
  448.  
  449.  
  450.  
  451.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement