Weird server script bug/ character auto loads?

So, currently in my game I’m waiting for a specific amount of players to join the game and then I start doing things, but what’s weird is that the server code is executing but its not creating the grid after the print debug statement, and theres enough players because its getting past the task.wait() statements

I have CharacterAutoLoads off, not sure why this would be an issue though?

The grid isnt being created, but weirdly the signal is being fired?

Here is the server script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Replicator = require(ReplicatedStorage.Replicator)
local Datastore = require(ReplicatedStorage.Datastore)
local RunService = game:GetService("RunService")

local NumberOfPlayersRequiredToStart = nil

game.Players.PlayerAdded:Connect(function(player)
   local joinData = player:GetJoinData()
   if joinData then
      local Members = joinData.Members
      if not NumberOfPlayersRequiredToStart and Members then
         NumberOfPlayersRequiredToStart = #Members
      end
   end
   if RunService:IsStudio() then
      NumberOfPlayersRequiredToStart = 1
   end
end)

repeat task.wait() until NumberOfPlayersRequiredToStart
repeat task.wait() until #game.Players:GetPlayers() >= NumberOfPlayersRequiredToStart

print("All players accounted for!")

local grid = {}

for j = 1, 3 do
   grid[j] = {}
   for k = 1, 3 do
      grid[j][k] = {}
      local area = nil
      if j == 1 and k == 2 then
         local SpawnLocation : SpawnLocation = Instance.new("SpawnLocation")
         SpawnLocation.Parent = workspace
         SpawnLocation.Position = Vector3.new(j * 64, 0, k * 64)
      end
      if j == 2 and k == 2 then
         continue
      else
         area = ReplicatedStorage.Templates.Default:Clone()
         area.Parent = workspace
         area.Position = Vector3.new(j * 64, 0, k * 64)
         area.Name = "Area" .. j .. k
      end
   end
end

task.wait(1)

if NumberOfPlayersRequiredToStart == 1 then
   Replicator._signalClients("BeginningCutscene", true)
end

Yeah turns out it had to do with streaming enabled, you just have to disable it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.