RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a text button that shows how many players are playing in a different game place."
-- Local script local textButton = script.Parent local HttpService = game:GetService("HttpService") local placeId = 123456789 -- Replace with the place ID of the game you want to check local function updatePlayerCount() local url = "https://games.roblox.com/v1/games/" .. placeId .. "/servers/Public?sortOrder=Asc&limit=10" local response = HttpService:GetAsync(url) local data = HttpService:JSONDecode(response) local playerCount = 0 for _, server in ipairs(data.data) do playerCount = playerCount + server.playing end textButton.Text = "Players in other place: " .. playerCount end updatePlayerCount() textButton.MouseButton1Click:Connect(updatePlayerCount)