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

Can someone help me fix this script?

Asked by
Miike0 6
8 years ago

I can't find the error in this script. It's supposed to generate random maps and teleport people to them using a block called "Tele Brick" which is placed within each map, but nothing happens. These maps are also all placed in lighting, by the way.

Each "if Maps..." is duplicated 8 times based on how many maps I'm loading up.

Intermission = 10
PlayTime = 90

while true do wait(Intermission)

Maps = (math.random(1,8)

    if Maps == 1 then
    Message = game.Players.LocalPlayer.PlayerGui.Output.Message
    Message.Text = "Map: Cobblestone Obby, by Miike0" 
    wait(5) 
    Message.Text = "Loading Map."
    wait(.5)
    Message.Text = "Loading Map.."
    wait(.5)
    Message.Text = "Loading Map..."
    wait(.5) 
    Message.Text = "Loading Map."
    wait(.1)
    Message.Text = "Teleporting Players"
    wait(.5)
    map = game.Lighting:FindFirstChild("Cobblestone Obby"):Clone()
    map.Parent = game.Workspace
    map.Name = "Map"
    map:MakeJoints()
    target = game.Workspace.Map["Tele Brick"] 
    for i, v in pairs(game.Players:GetChildren()) do
    v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0)
    Message.Text = "Good luck!"
    wait(2)
    Message.Transparency = 1    
    end
    wait(90) 
    Message.Transparency = .2
    game.Workspace.Map:remove()

end

    if Maps == 2 then 
    Message = game.Players.LocalPlayer.PlayerGui.Output.Message
    Message.Text = "Map: Bonus Obby, by Miike0" 
    wait(5) 
    Message.Text = "Loading Map."
    wait(.5)
    Message.Text = "Loading Map.."
    wait(.5)
    Message.Text = "Loading Map..."
    wait(.5) 
    Message.Text = "Loading Map."
    wait(.1)
    Message.Text = "Teleporting Players"
    wait(.5)
    map = game.Lighting:FindFirstChild("Bonus Obby"):Clone() 
    map.Parent = game.Workspace
    map.Name = "Map"
    map:MakeJoints()
    target = game.Workspace.Map["Tele Brick"] 
    for i, v in pairs(game.Players:GetChildren()) do
    v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0)
    Message.Text = "Good luck!"
    wait(2)
    Message.Transparency = 1    
    end
    wait(90) 
    Message.Transparency = .2
    game.Workspace.Map:remove()

end

if Maps == 3 then Message = game.Players.LocalPlayer.PlayerGui.Output.Message Message.Text = "Map: Fabric Obby, by Miike0" wait(5) Message.Text = "Loading Map." wait(.5) Message.Text = "Loading Map.." wait(.5) Message.Text = "Loading Map..." wait(.5) Message.Text = "Loading Map." wait(.1) Message.Text = "Teleporting Players" wait(.5) map = game.Lighting:FindFirstChild("Fabric Obby"):Clone() map.Parent = game.Workspace map.Name = "Map" map:MakeJoints() target = game.Workspace.Map["Tele Brick"] for i, v in pairs(game.Players:GetChildren()) do v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0) Message.Text = "Good luck!" wait(2) Message.Transparency = 1
end wait(90) Message.Transparency = .2 game.Workspace.Map:remove()

end

if Maps == 4 then Message = game.Players.LocalPlayer.PlayerGui.Output.Message Message.Text = "Map: Grass Obby, by Miike0" wait(5) Message.Text = "Loading Map." wait(.5) Message.Text = "Loading Map.." wait(.5) Message.Text = "Loading Map..." wait(.5) Message.Text = "Loading Map." wait(.1) Message.Text = "Teleporting Players" wait(.5) map = game.Lighting:FindFirstChild("Grass Obby"):Clone() map.Parent = game.Workspace map.Name = "Map" map:MakeJoints() target = game.Workspace.Map["Tele Brick"] v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0) Message.Text = "Good luck!" wait(2) Message.Transparency = 1
end wait(90) Message.Transparency = .2 game.Workspace.Map:remove()

end

if Maps == 5 then Message = game.Players.LocalPlayer.PlayerGui.Output.Message Message.Text = "Map: Neon Obby, by Miike0" wait(5) Message.Text = "Loading Map." wait(.5) Message.Text = "Loading Map.." wait(.5) Message.Text = "Loading Map..." wait(.5) Message.Text = "Loading Map." wait(.1) Message.Text = "Teleporting Players" wait(.5) map = game.Lighting:FindFirstChild("Neon Obby"):Clone() map.Parent = game.Workspace map.Name = "Map" map:MakeJoints() target = game.Workspace.Map["Tele Brick"] for i, v in pairs(game.Players:GetChildren()) do v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0) Message.Text = "Good luck!" wait(2) Message.Transparency = 1
end wait(90) Message.Transparency = .2 game.Workspace.Map:remove()

end

if Maps == 6 then Message = game.Players.LocalPlayer.PlayerGui.Output.Message Message.Text = "Map: Sand Obby, by Miike0" wait(5) Message.Text = "Loading Map." wait(.5) Message.Text = "Loading Map.." wait(.5) Message.Text = "Loading Map..." wait(.5) Message.Text = "Loading Map." wait(.1) Message.Text = "Teleporting Players" wait(.5) map = game.Lighting:FindFirstChild("Sand Obby"):Clone() map.Parent = game.Workspace map.Name = "Map" map:MakeJoints() target = game.Workspace.Map["Tele Brick"] for i, v in pairs(game.Players:GetChildren()) do v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0) Message.Text = "Good luck!" wait(2) Message.Transparency = 1
end wait(90) Message.Transparency = .2 game.Workspace.Map:remove()

end

if Maps == 7 then Message = game.Players.LocalPlayer.PlayerGui.Output.Message Message.Text = "Map: Slate Obby, by Miike0" wait(5) Message.Text = "Loading Map." wait(.5) Message.Text = "Loading Map.." wait(.5) Message.Text = "Loading Map..." wait(.5) Message.Text = "Loading Map." wait(.1) Message.Text = "Teleporting Players" wait(.5) map = game.Lighting:FindFirstChild("Slate Obby"):Clone() map.Parent = game.Workspace map.Name = "Map" map:MakeJoints() target = game.Workspace.Map["Tele Brick"]
for i, v in pairs(game.Players:GetChildren()) do v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0) Message.Text = "Good luck!" wait(2) Message.Transparency = 1
end wait(90) Message.Transparency = .2 game.Workspace.Map:remove()

end

if Maps == 8 then Message = game.Players.LocalPlayer.PlayerGui.Output.Message Message.Text = "Map: Wood Obby, by Miike0" wait(5) Message.Text = "Loading Map." wait(.5) Message.Text = "Loading Map.." wait(.5) Message.Text = "Loading Map..." wait(.5) Message.Text = "Loading Map." wait(.1) Message.Text = "Teleporting Players" wait(.5) map = game.Lighting:FindFirstChild("Wood Obby"):Clone() map.Parent = game.Workspace map.Name = "Map" map:MakeJoints() target = game.Workspace.Map["Tele Brick"] for i, v in pairs(game.Players:GetChildren()) do v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0) Message.Text = "Good luck!" wait(2) Message.Transparency = 1
end wait(90) Message.Transparency = .2 game.Workspace.Map:remove()

end

end

Answer this question