forked from zzerexx/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCBSpectatorViewer.lua
More file actions
73 lines (63 loc) · 2.19 KB
/
CBSpectatorViewer.lua
File metadata and controls
73 lines (63 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
local SpectatorViewer = Instance.new("ScreenGui")
local Main = Instance.new("Frame")
local UIListLayout = Instance.new("UIListLayout")
local Example = Instance.new("TextLabel")
--Properties:
SpectatorViewer.Name = "SpectatorViewer"
SpectatorViewer.Parent = game.CoreGui
SpectatorViewer.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
SpectatorViewer.DisplayOrder = 999999999
SpectatorViewer.ResetOnSpawn = false
Main.Name = "Main"
Main.Parent = SpectatorViewer
Main.Active = true
Main.AnchorPoint = Vector2.new(0.5, 0)
Main.AutomaticSize = Enum.AutomaticSize.XY
Main.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
Main.BorderSizePixel = 0
Main.Position = UDim2.new(0.5, 0, 0, 10)
Main.Size = UDim2.new(0, 150, 0, 30)
UIListLayout.Parent = Main
Example.Name = "Example"
Example.Parent = Main
Example.AnchorPoint = Vector2.new(0.5, 0)
Example.AutomaticSize = Enum.AutomaticSize.X
Example.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
Example.BackgroundTransparency = 1.000
Example.BorderSizePixel = 0
Example.Size = UDim2.new(0, 150, 0, 30)
Example.Font = Enum.Font.Gotham
Example.Text = "Player Name"
Example.TextColor3 = Color3.fromRGB(255, 255, 255)
Example.TextSize = 14.000
Example.Visible = false
-- Scripts:
local function LCIFE_fake_script() -- Main.LocalScript
local script = Instance.new('LocalScript', Main)
script.Parent.Draggable = true
local function GetSpectators()
local CurrentSpectators = {}
for i,v in pairs(game:GetService("Players"):GetChildren()) do
if v ~= game:GetService("Players").LocalPlayer and not v.Character and v:FindFirstChild("CameraCF") and (v.CameraCF.Value.Position - workspace.CurrentCamera.CFrame.p).Magnitude < 10 then
table.insert(CurrentSpectators, #CurrentSpectators+1, v)
end
end
return CurrentSpectators
end
while wait(0.25) do
for i,v in next, script.Parent:GetChildren() do
if v.Name ~= "Example" and not v:IsA("UIListLayout") and not v:IsA("LocalScript") then
v:Destroy()
end
end
for i,v in next, GetSpectators() do
local new = script.Parent.Example:Clone()
new.Parent = script.Parent
new.Visible = true
new.Name = v.Name
new.Text = v.Name
new.TextColor3 = v.TeamColor.Color
end
end
end
coroutine.wrap(LCIFE_fake_script)()