Hello,
I’m experimenting a bit with the new MessagingService and so far I’m having a bit of an issue with subscribing to a topic.
Here’s the script:
local messagingService = game:GetService("MessagingService")
local teleportService = game:GetService("TeleportService")
local test = game.ReplicatedStorage.Test
local findServers = game.ReplicatedStorage.FindServers
local foundServers = false
local teleportGUI = game.ReplicatedStorage.Teleporting
local placeID = 3143415630
local function findServer(server, unixTime)
if server == false then
else
foundServers = true
end
end
findServers.OnServerEvent:Connect(function(player)
messagingService:PublishAsync("FindServer", "AreThereActiveServers")
script.Parent.Text = "Finding Servers..."
wait(5)
messagingService:SubscribeAsync("ServerExistsConfirm", findServer)
wait(0.5)
if foundServers == false then
teleportService:Teleport(placeID, player, nil, teleportGUI)
end
end)
My ultimate goal with this system is to allow players in a lobby to pick a team colour (1 of 4) then be assigned to a server with that slot free as each team has a 1 player limit (4 player servers). The reason I want players to choose before entering a server is related to saved progress which is individual to the 4 team colours.
It’s a highly unfinished script and it will change as it’s currently just experimental, but I am constantly getting this error:
I cannot for the love of god figure out how to fix this.
I’m aware it’s in beta but I have seen people talk about working examples, has it been disabled temporarily or something?
Any tips on fixing this if possible?
Cheers, reddust1.