Advertisement
ttyyuu12345

Basic Building

Apr 29th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. --Created with ttyyuu12345's compiler
  2. --Errors:
  3. Create = function(itemClass,tabl)
  4. local item = Instance.new(itemClass)
  5. for i,v in pairs(tabl) do
  6. local a,b = ypcall(function() return item[i] end)
  7. if a then
  8. item[i] = tabl[i]
  9. end
  10. end
  11. return item
  12. end
  13. function runDummyScript(f,scri)
  14. local oldenv = getfenv(f)
  15. local newenv = setmetatable({}, {
  16. __index = function(_, k)
  17. if k:lower() == 'script' then
  18. return scri
  19. else
  20. return oldenv[k]
  21. end
  22. end
  23. })
  24. setfenv(f, newenv)
  25. ypcall(function() f() end)
  26. end
  27. cors = {}
  28. mas = Instance.new("Model",game:GetService("Lighting"))
  29. mas.Name = "CompiledModel"
  30. o1 = Create("Model",{
  31. ["Parent"] = mas,
  32. })
  33. o2 = Create("Part",{
  34. ["Parent"] = o1,
  35. ["Position"] = Vector3.new(7, 0.5, -11.5),
  36. ["Anchored"] = true,
  37. ["CFrame"] = CFrame.new(7, 0.5, -11.5, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  38. ["FormFactor"] = Enum.FormFactor.Symmetric,
  39. ["Size"] = Vector3.new(46, 1, 31),
  40. })
  41. o3 = Create("Part",{
  42. ["Parent"] = o1,
  43. ["Position"] = Vector3.new(-15.5, 12.0000124, -11.5),
  44. ["Anchored"] = true,
  45. ["CFrame"] = CFrame.new(-15.5, 12.0000124, -11.5, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  46. ["FormFactor"] = Enum.FormFactor.Symmetric,
  47. ["Size"] = Vector3.new(1, 22, 31),
  48. })
  49. o4 = Create("Part",{
  50. ["Parent"] = o1,
  51. ["Position"] = Vector3.new(29.5, 12, -11.5),
  52. ["Anchored"] = true,
  53. ["CFrame"] = CFrame.new(29.5, 12, -11.5, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  54. ["FormFactor"] = Enum.FormFactor.Symmetric,
  55. ["Size"] = Vector3.new(1, 22, 31),
  56. })
  57. o5 = Create("Part",{
  58. ["Parent"] = o1,
  59. ["Position"] = Vector3.new(7.00000095, 12, -26.5),
  60. ["Rotation"] = Vector3.new(0, 90, 0),
  61. ["Anchored"] = true,
  62. ["CFrame"] = CFrame.new(7.00000095, 12, -26.5, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  63. ["FormFactor"] = Enum.FormFactor.Symmetric,
  64. ["Size"] = Vector3.new(1, 22, 44),
  65. })
  66. o6 = Create("Part",{
  67. ["Parent"] = o1,
  68. ["Position"] = Vector3.new(21.5, 12, 3.5),
  69. ["Rotation"] = Vector3.new(0, 90, 0),
  70. ["Anchored"] = true,
  71. ["CFrame"] = CFrame.new(21.5, 12, 3.5, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  72. ["FormFactor"] = Enum.FormFactor.Symmetric,
  73. ["Size"] = Vector3.new(1, 22, 15),
  74. })
  75. o7 = Create("Part",{
  76. ["Parent"] = o1,
  77. ["Position"] = Vector3.new(-7.5, 12, 3.5),
  78. ["Rotation"] = Vector3.new(-0, 90, 0),
  79. ["Anchored"] = true,
  80. ["CFrame"] = CFrame.new(-7.5, 12, 3.5, -0, 0, 1, -0, 1, 0, -1, 0, 0),
  81. ["FormFactor"] = Enum.FormFactor.Symmetric,
  82. ["Size"] = Vector3.new(1, 22, 15),
  83. })
  84. o8 = Create("Part",{
  85. ["Parent"] = o1,
  86. ["Position"] = Vector3.new(7, 23.5000248, -11.5),
  87. ["Anchored"] = true,
  88. ["CFrame"] = CFrame.new(7, 23.5000248, -11.5, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  89. ["FormFactor"] = Enum.FormFactor.Symmetric,
  90. ["Size"] = Vector3.new(46, 1, 31),
  91. })
  92. o9 = Create("Part",{
  93. ["Parent"] = o1,
  94. ["Transparency"] = 0.5,
  95. ["Position"] = Vector3.new(7, 12, 3.5),
  96. ["Rotation"] = Vector3.new(0, 90, 0),
  97. ["Anchored"] = true,
  98. ["CFrame"] = CFrame.new(7, 12, 3.5, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  99. ["FormFactor"] = Enum.FormFactor.Symmetric,
  100. ["Size"] = Vector3.new(1, 22, 14),
  101. })
  102. o10 = Create("ClickDetector",{
  103. ["Parent"] = o9,
  104. })
  105. o11 = Create("Script",{
  106. ["Parent"] = o9,
  107. })
  108. table.insert(cors,coroutine.create(function()
  109. wait()
  110. runDummyScript(function()
  111. local door = script.Parent
  112. local open = false
  113. script.Parent.ClickDetector.MouseClick:connect(function(pl)
  114. if open then
  115. open = false
  116. door.Transparency = 0.5
  117. door.CanCollide = true
  118. else
  119. open = true
  120. door.Transparency = 1
  121. door.CanCollide = false
  122. end
  123. end)
  124. end,o11)
  125. end))
  126. mas.Parent = workspace
  127. mas:MakeJoints()
  128. local mas1 = mas:GetChildren()
  129. for i=1,#mas1 do
  130. mas1[i].Parent = script
  131. ypcall(function() mas1[i]:MakeJoints() end)
  132. end
  133. mas:Destroy()
  134. for i=1,#cors do
  135. coroutine.resume(cors[i])
  136. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement