RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a text button that shows how many players are playing in a different game place."
-- Local Script in TextButton local textButton = script.Parent local Players = game:GetService("Players") local TeleportService = game:GetService("TeleportService") local placeId = 123456789 -- Replace with the PlaceId of the other game place local function updatePlayerCount() local success, playerCount = pcall(TeleportService.GetPlacePlayerCountAsync, TeleportService, placeId) if success then textButton.Text = "Players in other place: " .. playerCount else textButton.Text = "Error fetching player count" end end updatePlayerCount() while wait(60) do -- Update every 60 seconds updatePlayerCount() end