Advertisement
Guest User

Roblox Spectate GUI Script! (zovoplayz)

a guest
Jun 4th, 2021
4,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | None | 0 0
  1.  
  2. cam = game.Workspace.CurrentCamera
  3.  
  4. local bar = script.Parent.Bar
  5. local title = bar.Title
  6. local prev = bar.Previous
  7. local nex = bar.Next
  8. local button = script.Parent.Button
  9.  
  10. function get()
  11.  for _,v in pairs(game.Players:GetPlayers())do
  12.   if v.Name == title.Text then
  13.    return(_)
  14.   end
  15.  end
  16. end
  17.  
  18.  
  19. local debounce = false
  20. button.MouseButton1Click:connect(function()
  21.  if debounce == false then debounce = true
  22.   bar:TweenPosition(UDim2.new(.5,-100,0.88,-50),"In","Linear",1,true)
  23.   pcall(function()
  24.     title.Text = game.Players:GetPlayerFromCharacter(cam.CameraSubject.Parent).Name
  25.   end)
  26.  elseif debounce == true then debounce = false
  27.   pcall(function() cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid end)
  28.    bar:TweenPosition(UDim2.new(-1,-100,0.88,-50),"In","Linear",1,true)
  29.   end
  30. end)
  31.  
  32. prev.MouseButton1Click:connect(function()
  33.  wait(.1)
  34.  local players = game.Players:GetPlayers()
  35.  local num = get()
  36.  if not pcall(function()
  37.   cam.CameraSubject = players[num-1].Character.Humanoid
  38.   end) then
  39.   cam.CameraSubject = players[#players].Character.Humanoid
  40.  end
  41. pcall(function()
  42.     title.Text = game.Players:GetPlayerFromCharacter(cam.CameraSubject.Parent).Name
  43.   end)
  44. end)
  45.  
  46. nex.MouseButton1Click:connect(function()
  47.  wait(.1)
  48.  local players = game.Players:GetPlayers()
  49.  local num = get()
  50.  if not pcall(function()
  51.   cam.CameraSubject = players[num+1].Character.Humanoid
  52.   end) then
  53.   cam.CameraSubject = players[1].Character.Humanoid
  54.  end
  55. pcall(function()
  56.     title.Text = game.Players:GetPlayerFromCharacter(cam.CameraSubject.Parent).Name
  57.   end)
  58. end)
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement