I am making a Hide and Seek game. I am doing the gameplay scripting, but my game won't even run the first section of my script! I added a print to test if it got that far, it does not. I realize it is most likely an easy fix, but I cannot find it.
local roundtimer = 60 * 3
local intermissiontime = 5
local serverstorage = game:GetService("ServerStorage")
local replicatedstorage = game:GetService("ReplicatedStorage")
local debris = game:GetService("Debris")
local event = replicatedstorage:WaitForChild("RemoteEvent")
local maps = serverstorage:WaitForChild("Maps")
local mapholder = game.Workspace:WaitForChild("MapHolder")
while true do
print("we made it")
--Wait for contestants
while true do
wait(1)
contestants = {}
for _, player in pairs(game.Players:GetPlayers()) do
local humanoid = player.Character:WaitForChild("Humanoid")
if humanoid and humanoid.Health > 0 then
table.insert(contestants, player)
end
end
end
if #contestants >= 2 then
print("we have enough")
break
end
--Load a random map
mapholder:ClearAllChildren()
wait(2)
local allmaps = maps:GetChildren()
local newmap = allmaps[math.random(1, #allmaps)]
newmap.Parent = game.Workspace
print(newmap.Name)
wait(2)
I am not getting anything in the output from my prints, but I am getting this error twice:
22:16:07.567 - Replication: Can't create default object of type Workspace
and I am also getting this in red:
(a huge link with personal data): WinHttpReceiveResponse, err=0x2EE2
Thanks in advance.
**UPDATE
I changed up the variables, I think that was the issue. But now I am getting stuck when checking for enough players to play.
local roundtimer = 60 * 3
local intermissiontime = 5
local serverstorage = game.ServerStorage
local replicatedstorage = game.ReplicatedStorage
--local debris = game:GetService("Debris") I'm not using this so I hinted it
--local event = replicatedstorage.RemoteEvent I'm not using this so I hinted it
local maps = game.ServerStorage.Maps
local mapholder = game.Workspace.MapHolder
while true do
print("here") -- this prints
--Load a random map
mapholder:ClearAllChildren()
wait(2)
local allmaps = maps:GetChildren()
local newmap = allmaps[math.random(1, #allmaps)]:clone()
newmap.Parent = game.Workspace
print(newmap.Name) -- this prints
wait(2)
--Wait for contestants
while true do
print("this works") -- this prints over and over again even though I am using the Test feature with two players
wait(1)
contestants = {}
for _, player in pairs(game.Players:GetPlayers()) do
local humanoid = player.Character:WaitForChild("Humanoid")
if humanoid and humanoid.Health > 0 then
table.insert(contestants, player)
end
end
end
if #contestants >= 2 then
print("we have enough") -- this does not print
break
end

1 comment
I would thumbs you up but I'm not high enough cause someone gave me a bunch of thumbs downs for no reason :/