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

Can someone help me find the error in 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.

Intermission = 10  
PlayTime = 90


while true do
    wait(Intermission) 

        Maps = (math.random(1,2)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        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 

0
have you tried debugging? which is placing prints everywhere and finding out where it stops TheTermaninator 45 — 8y
0
I have, but I'll try again. Miike0 6 — 8y

1 answer

Log in to vote
0
Answered by
alibix123 175
8 years ago
Maps = (math.random(1,2)

should be

Maps = math.random(1,2)
Ad

Answer this question