I can’t get my script to work, can somebody please help me?
Script:
game:GetService(“StarterGui”):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
local Main = script.Parent.Main
local Players = game:GetService(“Players”)
local u1 = false
local u2 = require(Main.Parent.Parent.Parent.MenuFunctions2)
local u3 = nil
local function updatePlayerList()
local playerCount = #game.Players:GetPlayers()
script.Parent.Main.List.Header.Players.Text = “Players (” … playerCount … “)”
for _, v in pairs(game.Players:GetPlayers()) do
local playerLayout = script.Parent.Main.List.ScrollingFrame:FindFirstChild(v.Name)
if playerLayout then
playerLayout:Destroy()
end
local listItem = script.ListItem:Clone()
listItem.Parent = script.Parent.Main.List.ScrollingFrame
listItem.Username.Text = v.Name
listItem.DisplayName.Text = v.DisplayName
listItem.Avatar.Image = "rbxthumb://type=AvatarHeadShot&id=" .. tostring(v.UserId) .. "&w=180&h=180"
listItem.Name = v.Name
if v:FindFirstChild("Device") then
if v.Device.Value == "Tablet" then
listItem.Device.Image = "http://www.roblox.com/asset/?id=5606203139"
else
listItem.Device.Image = "http://www.roblox.com/asset/?id=5606203135"
end
else
listItem.Device.Image = "http://www.roblox.com/asset/?id=5606203135"
end
spawn(function()
if v:GetRankInGroup(7683625) >= 120 and listItem and listItem.Parent then
listItem:WaitForChild("ModIcon").Visible = true
listItem:WaitForChild("Username").Position = UDim2.new(0, 95, 0.52, 0)
listItem:WaitForChild("DisplayName").Position = UDim2.new(0, 97, 0.05, 0)
end
end)
listItem.Parent = script.Parent.Main.List.ScrollingFrame
listItem.Visible = true
u2.ListItem_MouseHoverConnections(listItem, Main)
listItem.MouseButton1Down:Connect(function()
if u1 then
return
end
if u3 and u3 == listItem then
return
end
if u3 then
u2.ListItem_Deselect(u3)
end
u3 = listItem
u2.ListItem_Select(listItem)
Main.NoSelection.Visible = false
Main.Details.Visible = true
Main.Details.Profile.Avatar.Image = "rbxthumb://type=AvatarBust&id=" .. tostring(v.UserId) .. "&w=180&h=180"
Main.Details.Profile.Username.Text = "@" .. v.Name
Main.Details.Profile.DisplayName.Text = v.RoleplayName.Value
Main.Details.Profile.StatusDetails.GameMod.Text = "OFFICIAL TCRP GAME MOD"
Main.Details.Profile.StatusDetails.GameMod.Visible = listItem.ModIcon.Visible
Main.Details.Profile.StatusDetails.Supporter.Visible = false
Main.Details.Profile.Stats.Wanted.Amount.Text = ""
Main.Details.Profile.Stats.LawXP.Amount.Text = ""
Main.Details.Profile.Stats.DoTXP.Amount.Text = ""
Main.Details.Profile.Stats.FireXP.Amount.Text = ""
Main.Details.Profile.Stats.Badges.Amount.Text = ""
Main.Details.Profile.Stats.JobPoints.Amount.Text = ""
u1 = true
u2.ToggleLoading(true)
local u15 = nil
spawn(function()
if v:GetRankInGroup(7683625) >= 224 then
Main.Details.Profile.StatusDetails.GameMod.Text = "TCRP " .. v:GetRoleInGroup(4328109)
end
u15 = true
end)
end)
end
end
game.Players.PlayerRemoving:Connect(function(plr)
local playerLayout = script.Parent.Main.List.ScrollingFrame:FindFirstChild(plr.Name)
if playerLayout then
playerLayout:Destroy()
end
end)
while true do
wait()
updatePlayerList()
end