Advertisement
FazeWolfyBoy

Spectate

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