Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LoadMap = function(Objects, Lighting_Info)
- local Objs = {}
- for i,v in next, Objects do
- game:GetService("RunService").Heartbeat:Wait()
- if v.className then
- local Inst = Instance.new(v.className:sub(1, #v.className - 1))
- table.insert(Objs, Inst)
- for a, b in pairs(v) do
- local x, y = pcall(function()
- Inst[a] = type(b) == "string" and b:sub(1, #b - 1) or b
- end)
- if not x then
- if y:match("(Instance expected, got string)") then
- spawn(function()
- local Obj
- pcall(function()
- Obj = loadstring("return "..b:sub(1, #b - 1))()
- end)
- if not Obj then
- repeat
- wait()
- pcall(function()
- Obj = loadstring("return "..b:sub(1, #b - 1))()
- end)
- until Obj
- end
- Inst[a] = Obj
- end)
- end
- end
- end
- spawn(function()
- local Obj
- pcall(function()
- Obj = loadstring("return "..v.Parent:sub(1, #v.Parent - 1))()
- end)
- if not Obj then
- repeat
- wait()
- pcall(function()
- Obj = loadstring("return "..v.Parent:sub(1, #v.Parent - 1))()
- end)
- until Obj
- end
- Inst.Parent = Obj
- end)
- end
- end
- for i, v in next, Objs do
- if v:IsA("Seat") and v:FindFirstChild("SeatWeld") then
- v["SeatWeld"]:Destroy()
- end
- v.Name = v.Name:sub(1, #v.Name - 13)
- end
- for i,v in next, Lighting_Info do
- game:GetService("Lighting")[i] = type(v) == "string" and v:sub(1, #v -1) or v
- end
- end
- LoadMap(Map, Lighting)
Add Comment
Please, Sign In to add comment