Hey all! So I am trying to make a modded arcade style game where you can pick up different guns, and mid coding, I came across a warning that said Warning: [A62ED54F5D69A344] APIBasicGameState:72 Cannot get game state with no manager registered
I have a basic game state manager script, so I have no idea why this error is caused. If anyone can give a little insight that would be much appreciated!
local ABGS = require(script:GetCustomProperty("API"))
ABGS.RegisterGameStateManagerServer(script:GetCustomProperty("BasicGameStateManagerServer"))
ABGS.RegisterGameStateManagerClient()
-- nil Tick(float)
-- Watches for a player hitting the maximum equipment list count and ends the round
function Tick(deltaTime)
if not ABGS.IsGameStateManagerRegistered() then
return
end
end
if ABGS.GetGameState() == ABGS.GAME_STATE_ROUND then
local winner = nil
for _, player in pairs(Game.GetPlayers()) do
if player.kills > 2 then
winner = player
end
end
if winner then
Events.Broadcast("PlayerVictory", winner)
ABGS.SetGameState(ABGS.GAME_STATE_ROUND_END)
end
end
Game.roundStartEvent:Connect(function()
local SpawnPartsRed = script:GetCustomProperty("RedSpawnParts"):WaitForObject()
local SpawnPartsBlue = script:GetCustomProperty("BlueSpawnParts"):WaitForObject()
local spawns = script:GetCustomProperty("Spawns"):WaitForObject()
local maps = {"Red", "Green"}
local mapChoice = math.random(1, #maps)
if mapChoice == "Red" then
for i, v in pairs(spawns:GetChildren()) do
for x, p in pairs(SpawnPartsRed:GetChildren()) do
v.Position = p.Position
end
end
elseif mapChoice == "Blue" then
for i, v in pairs(spawns:GetChildren()) do
for x, p in pairs(SpawnPartsBlue:GetChildren()) do
v.Position = p.Position
end
end
end
end)
This is the code that I suspect is causing the error, I can also send the functions that actually sent the error!