Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-3

My script won't start. Please help me. Why wont start? hfegdfwgafhygfawyhdghydfgywfegf [closed]

Asked by 3 years ago
Edited by Gey4Jesus69 3 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

my script is

local MapsFolder = game.ReplicatedStorage:WaitForChild("Maps")
local Status = game.ReplicatedStorage:WaitForChild("Status")

while true do
 Status.Value = "Intermission 15"
 local interTime = 15
 repeat wait()
  wait(1)
  interTime = interTime - 1
  Status.Value = "Intermission "..interTime
 until interTime <= 0
 wait(1)
 Status.Value = "Selecting a map"

 local mapId = math.random(1,#MapsFolder:GetChildren())
 local map = MapsFolder:FindFirstChild("Map"..mapId)

 wait(1)
 if map then
  Status.Value = "Map has been chosen"

  local mapName = map:FindFirstChild("MapName")
  if mapName then
   Status.Value = "The map is: "..mapName.Value
  else
   Status.Value = "The map doesn't have a name"
  end
  wait(1)
  Status.Value = "Loading map..."

  local newMap
  newMap = map:Clone()
  newMap.Parent = workspace
  newMap.Name = "Map"

  wait(2)

  Status.Value = "Teleporting players..."
     if newMap:FindFirstChild("PlayerSpawns") then
      for i,v in pairs(game.Players:GetPlayers()) do
   local character = workspace:FindFirstChild(v.Name)
   if character then
    local rootPart = character:FindFirstChild("HumanoidRootPart")
    if rootPart then
     local spawnId = math.random(1,#newMap.PlayerSpawns:GetChildren())
        local spawnObj = newMap.PlayerSpawns:FindFirstChild("Spawn"..spawnId)

        if spawnObj then
        rootPart.Position = spawnObj.Position
        end
    end
   end
  end
  wait(2)
 else
  Status.Value = "Map doesn't have spawns! Can't load"
     end
 else
  Status.Value = "Failed to find a map"
 end 

 if workspace:FindFirstChild("Map") then
  workspace.Map:Destroy()
 end

 wait(2)
end 

The script wont start for some reason please tell me why

0
There are no line breaks in your code... iiii676 23 — 3y

Closed as Not Constructive by imKirda and BestCreativeBoy

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?