Advertisement
oatmeal2009

spectate gui

Feb 21st, 2022
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. gui = Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
  2. nextb = Instance.new("TextButton", gui)
  3. nextb.Position = UDim2.new(0.88,0,0.9,0)
  4. nextb.Size = UDim2.new(0.1,0,0.07,0)
  5. nextb.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
  6. nextb.Text = "Next"
  7. prevb = nextb:Clone()
  8. prevb.Position = UDim2.new(0.02,0,0.9,0)
  9. prevb.Text = "Previous"
  10. prevb.Parent = gui
  11. plrNum = 1
  12. for i,v in pairs(game.Players:GetPlayers()) do
  13. if i == plrNum then
  14. game.Workspace.Camera.CameraSubject = v.Character.Humanoid
  15. end
  16. end
  17.  
  18. prevb.MouseButton1Down:connect(function()
  19. if plrNum ~= 1 then
  20. plrNum = plrNum - 1
  21. end
  22. for i,v in pairs(game.Players:GetPlayers()) do
  23. if i == plrNum then
  24. game.Workspace.Camera.CameraSubject = v.Character.Humanoid
  25. end
  26. end
  27. end)
  28.  
  29. nextb.MouseButton1Down:connect(function()
  30. if plrNum < #game.Players:GetPlayers() then
  31. plrNum = plrNum + 1
  32. for i,v in pairs(game.Players:GetPlayers()) do
  33. if i == plrNum then
  34. game.Workspace.Camera.CameraSubject = v.Character.Humanoid
  35. end
  36. end
  37. end
  38. end)
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement