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

[Just to be double sure] any errors with this script?

Asked by
KenzaXI 166
9 years ago
local Map1 = game.Lighting.Map1
while true do
    wait(420)
    if (game.Workspace.Map1 ~= nil) then
        game.Workspace.Map1:Destroy()
    end
    local M = Instance.new("Message", game.Workspace)
    M.Text = "Inserting Toxic Speed"
    wait(2)
    Map1:Clone().Parent = game.Workspace
    M:Remove()
    wait(1)
end

It's a Map Changing script, I couldn't find any errors in output, Can you? Thanks.

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

Indexing game objects directly will error if they do not exist. if (game.Workspace.Map1 ~= nil) then should be replaced with if workspace:FindFirstChild("Map1")then

Ad

Answer this question