qiell

universal spectateb(OP)

Feb 1st, 2024
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. local runDummyScript = function(f,scri)
  2. local oldenv = getfenv(f)
  3. local newenv = setmetatable({}, {
  4. __index = function(_, k)
  5. if k:lower() == 'script' then
  6. return scri
  7. else
  8. return oldenv[k]
  9. end
  10. end
  11. })
  12. setfenv(f, newenv)
  13. ypcall(function() f() end)
  14. end
  15. cors = {}
  16. mas = Instance.new("Model",game:GetService("Lighting"))
  17. mas.Name = "CompiledModel"
  18. o1 = Instance.new("ScreenGui")
  19. o2 = Instance.new("Frame")
  20. o3 = Instance.new("TextButton")
  21. o4 = Instance.new("TextButton")
  22. o5 = Instance.new("TextLabel")
  23. o6 = Instance.new("ImageButton")
  24. o7 = Instance.new("LocalScript")
  25. o1.Name = "SpectateGui"
  26. o1.Parent = mas
  27. o2.Name = "Bar"
  28. o2.Parent = o1
  29. o2.Position = UDim2.new(-1,-100,0.87999999523163,-50)
  30. o2.Size = UDim2.new(0,200,0,50)
  31. o2.Position = UDim2.new(-1,-100,0.87999999523163,-50)
  32. o2.BackgroundColor3 = Color3.new(0, 0, 0)
  33. o2.BackgroundTransparency = 0.20000000298023
  34. o2.BorderSizePixel = 5
  35. o3.Name = "Previous"
  36. o3.Parent = o2
  37. o3.Size = UDim2.new(0.25,0,1,0)
  38. o3.Text = "<"
  39. o3.BackgroundColor3 = Color3.new(0.52549, 0.52549, 0.52549)
  40. o3.BorderColor3 = Color3.new(0.509804, 0.796079, 1)
  41. o3.BorderSizePixel = 0
  42. o3.Font = Enum.Font.SourceSans
  43. o3.FontSize = Enum.FontSize.Size48
  44. o3.TextColor3 = Color3.new(1, 1, 1)
  45. o4.Name = "Next"
  46. o4.Parent = o2
  47. o4.Position = UDim2.new(1,0,0,0)
  48. o4.Size = UDim2.new(-0.25,0,1,0)
  49. o4.Text = ">"
  50. o4.Position = UDim2.new(1,0,0,0)
  51. o4.BackgroundColor3 = Color3.new(0.52549, 0.52549, 0.52549)
  52. o4.BorderColor3 = Color3.new(0.509804, 0.796079, 1)
  53. o4.BorderSizePixel = 0
  54. o4.Font = Enum.Font.SourceSans
  55. o4.FontSize = Enum.FontSize.Size48
  56. o4.TextColor3 = Color3.new(1, 1, 1)
  57. o5.Name = "Title"
  58. o5.Parent = o2
  59. o5.Position = UDim2.new(0.27500000596046,0,0,0)
  60. o5.Size = UDim2.new(0.44999998807907,0,1,0)
  61. o5.Text = ""
  62. o5.Position = UDim2.new(0.27500000596046,0,0,0)
  63. o5.BackgroundColor3 = Color3.new(1, 1, 1)
  64. o5.BackgroundTransparency = 1
  65. o5.Font = Enum.Font.SourceSans
  66. o5.FontSize = Enum.FontSize.Size14
  67. o5.TextColor3 = Color3.new(1, 1, 1)
  68. o5.TextScaled = true
  69. o5.TextWrapped = true
  70. o6.Name = "Button"
  71. o6.Parent = o1
  72. o6.Position = UDim2.new(0,0,0.5,-25)
  73. o6.Size = UDim2.new(0,50,0,50)
  74. o6.Position = UDim2.new(0,0,0.5,-25)
  75. o6.BackgroundColor3 = Color3.new(1, 1, 1)
  76. o6.BackgroundTransparency = 0.30000001192093
  77. o6.BorderSizePixel = 5
  78. o6.Image = "http://www.roblox.com/asset/?id=176106970"
  79. o7.Parent = o1
  80. table.insert(cors,coroutine.create(function()
  81. wait()
  82. runDummyScript(function()
  83.  
  84. cam = game.Workspace.CurrentCamera
  85.  
  86. local bar = script.Parent.Bar
  87. local title = bar.Title
  88. local prev = bar.Previous
  89. local nex = bar.Next
  90. local button = script.Parent.Button
  91.  
  92. function get()
  93. for _,v in pairs(game.Players:GetPlayers())do
  94. if v.Name == title.Text then
  95. return(_)
  96. end
  97. end
  98. end
  99.  
  100.  
  101. local debounce = false
  102. button.MouseButton1Click:connect(function()
  103. if debounce == false then debounce = true
  104. bar:TweenPosition(UDim2.new(.5,-100,0.88,-50),"In","Linear",1,true)
  105. pcall(function()
  106. title.Text = game.Players:GetPlayerFromCharacter(cam.CameraSubject.Parent).Name
  107. end)
  108. elseif debounce == true then debounce = false
  109. pcall(function() cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid end)
  110. bar:TweenPosition(UDim2.new(-1,-100,0.88,-50),"In","Linear",1,true)
  111. end
  112. end)
  113.  
  114. prev.MouseButton1Click:connect(function()
  115. wait(.1)
  116. local players = game.Players:GetPlayers()
  117. local num = get()
  118. if not pcall(function()
  119. cam.CameraSubject = players[num-1].Character.Humanoid
  120. end) then
  121. cam.CameraSubject = players[#players].Character.Humanoid
  122. end
  123. pcall(function()
  124. title.Text = game.Players:GetPlayerFromCharacter(cam.CameraSubject.Parent).Name
  125. end)
  126. end)
  127.  
  128. nex.MouseButton1Click:connect(function()
  129. wait(.1)
  130. local players = game.Players:GetPlayers()
  131. local num = get()
  132. if not pcall(function()
  133. cam.CameraSubject = players[num+1].Character.Humanoid
  134. end) then
  135. cam.CameraSubject = players[1].Character.Humanoid
  136. end
  137. pcall(function()
  138. title.Text = game.Players:GetPlayerFromCharacter(cam.CameraSubject.Parent).Name
  139. end)
  140. end)
  141.  
  142.  
  143. end,o7)
  144. end))
  145. mas.Parent = workspace
  146. mas:MakeJoints()
  147. local mas1 = mas:GetChildren()
  148. for i=1,#mas1 do
  149. mas1[i].Parent = game:GetService("Players").LocalPlayer.PlayerGui
  150. ypcall(function() mas1[i]:MakeJoints() end)
  151. end
  152. mas:Destroy()
  153. for i=1,#cors do
  154. coroutine.resume(cors[i])
  155. end
Add Comment
Please, Sign In to add comment