Hi!
My script for Minigame Selection for some reason only works in studio.
(for some reason as soon as I started making this thread it broke completely. It only broke when I disabled it for like 5 mins for testing.
Studio:
InGame: (did not TP me)
Code:
Intermission = 30
PlayTime = 90
while true do
wait(Intermission)
Maps = (math.random(1,3))
if Maps == 1 then
map = game.Lighting:FindFirstChild("Map2"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
target = game.Workspace.Map["Spawn1"]
for i, v in pairs(game.Players:GetChildren()) do
print "6block spawned!"
v.Character:WaitForChild("HumanoidRootPart").CFrame = target.CFrame + Vector3.new(0,4,0)
wait (PlayTime)
game.Workspace.Map:remove()
print "6block despawned!"
end
elseif Maps == 2 then
map = game.Lighting:FindFirstChild("Map1"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
target = game.Workspace.Map["SpawnPart"]
for i, v in pairs(game.Players:GetChildren()) do
print "4block spawned!"
v.Character:WaitForChild("HumanoidRootPart").CFrame = target.CFrame + Vector3.new(0,4,0)
print "4block teleported!"
wait(2)
end
wait(PlayTime)
game.Workspace.Map:remove()
elseif Maps == 3 then
map = game.Lighting:FindFirstChild("Map3"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
target = game.Workspace.Map["Spawn1"]
for i, v in pairs(game.Players:GetChildren()) do
print "risinglava spawned!"
v.Character:WaitForChild("HumanoidRootPart").CFrame = target.CFrame + Vector3.new(0,4,0)
wait(2)
end
wait(PlayTime)
game.Workspace.Map:remove()
end
end
Intermission = 30
PlayTime = 90
while true do
wait(Intermission)
Maps = (math.random(1,3))
if Maps == 1 then
map = game.Lighting:FindFirstChild("Map2"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
target = game.Workspace.Map["Spawn1"]
for i, v in pairs(game.Players:GetChildren()) do
print "6block spawned!"
repeat wait() until v.Character
v.Character:WaitForChild("HumanoidRootPart").CFrame = target.CFrame + Vector3.new(0,4,0)
wait (PlayTime)
game.Workspace.Map:remove()
print "6block despawned!"
end
elseif Maps == 2 then
map = game.Lighting:FindFirstChild("Map1"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
target = game.Workspace.Map["SpawnPart"]
for i, v in pairs(game.Players:GetChildren()) do
print "4block spawned!"
repeat wait() until v.Character
v.Character:WaitForChild("HumanoidRootPart").CFrame = target.CFrame + Vector3.new(0,4,0)
print "4block teleported!"
wait(2)
end
wait(PlayTime)
game.Workspace.Map:remove()
elseif Maps == 3 then
map = game.Lighting:FindFirstChild("Map3"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
target = game.Workspace.Map["Spawn1"]
for i, v in pairs(game.Players:GetChildren()) do
print "risinglava spawned!"
repeat wait() until v.Character
v.Character:WaitForChild("HumanoidRootPart").CFrame = target.CFrame + Vector3.new(0,4,0)
wait(2)
end
wait(PlayTime)
game.Workspace.Map:remove()
end
end
Make sure that you haven’t added anything in this service:
Because the code says that there is a cloned or a placed object called Atmosphere in there.