Advertisement
Upscalefanatic34

Tmm House

May 25th, 2016
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.38 KB | None | 0 0
  1. model = Instance.new("Model", workspace)
  2. model.Name = "Message"
  3.  
  4. adminlist = {"Upscalegaming"}
  5.  
  6. function MakePart(si,ff,cfa,cf,co,na)
  7. local p = Instance.new("Part",house2)
  8. p.Name,p.Anchored,p.Locked = na,true,true
  9. p.formFactor,p.BrickColor = ff,BrickColor.new(co)
  10. p.Size,p.TopSurface,p.BottomSurface = si,"Smooth","Smooth"
  11. p.CFrame = cf*cfa
  12. return p
  13. end
  14.  
  15. function makebrick(parent)
  16. a = Instance.new("Part", parent)
  17. a.TopSurface = "Smooth"
  18. a.BottomSurface = "Smooth"
  19. a.Anchored = true
  20. a.formFactor = "Custom"
  21. return a
  22. end
  23.  
  24. door = makebrick(model)
  25. door.Name = "Door"
  26. door.BrickColor = BrickColor.new("Deep blue")
  27. door.Size = Vector3.new(10, 11, 1)
  28. door.CFrame = CFrame.new(0, 406.9, 49.5)
  29. door.CanCollide = true
  30.  
  31. deck1 = makebrick(model)
  32. deck1.Name = "Deck1"
  33. deck1.BrickColor = BrickColor.new("Really black")
  34. deck1.Size = Vector3.new(100, 1, 1)
  35. deck1.CFrame = CFrame.new(0, 400.9, 50.5)
  36.  
  37. deck2 = makebrick(model)
  38. deck2.Name = "Deck2"
  39. deck2.BrickColor = BrickColor.new("Really black")
  40. deck2.Size = Vector3.new(1, 1, 100)
  41. deck2.CFrame = CFrame.new(-50.5, 400.9, 0)
  42.  
  43. deck3 = makebrick(model)
  44. deck3.Name = "Deck3"
  45. deck3.BrickColor = BrickColor.new("Really black")
  46. deck3.Size = Vector3.new(1, 1, 100)
  47. deck3.CFrame = CFrame.new(50.5, 400.9, 0)
  48.  
  49. h2 = makebrick(model)
  50. h2.Name = "Hatch2"
  51. h2.BrickColor = BrickColor.new("Really black")
  52. h2.Size = Vector3.new(10, 1, 20)
  53. h2.CFrame = CFrame.new(5, 419.9, 0)
  54.  
  55. h1 = makebrick(model)
  56. h1.Name = "Hatch1"
  57. h1.BrickColor = BrickColor.new("Really black")
  58. h1.Size = Vector3.new(10, 1, 20)
  59. h1.CFrame = CFrame.new(-5, 419.9, 0)
  60.  
  61. e = makebrick(model)
  62. e.Name = "Elevator"
  63. e.BrickColor = BrickColor.new("Institutional white")
  64. e.Size = Vector3.new(20, 1, 20)
  65. e.CFrame = CFrame.new(0, 401.9, 0)
  66.  
  67. bottom = makebrick(model)
  68. bottom.Name = "Bottom"
  69. bottom.BrickColor = BrickColor.new("Really black")
  70. bottom.Size = Vector3.new(100, 1, 80)
  71. bottom.CFrame = CFrame.new(0, 400.9, 10)
  72.  
  73. bottom3 = makebrick(model)
  74. bottom3.Name = "Bottom2"
  75. bottom3.BrickColor = BrickColor.new("Really black")
  76. bottom3.Size = Vector3.new(80, 1, 20)
  77. bottom3.CFrame = CFrame.new(-10, 400.9, -40)
  78.  
  79. h4 = makebrick(model)
  80. h4.Name = "Hatch4"
  81. h4.BrickColor = BrickColor.new("Really black")
  82. h4.Size = Vector3.new(10, 1, 20)
  83. h4.CFrame = CFrame.new(45, 400.9, -40)
  84.  
  85. h3 = makebrick(model)
  86. h3.Name = "Hatch3"
  87. h3.BrickColor = BrickColor.new("Really black")
  88. h3.Size = Vector3.new(10, 1, 20)
  89. h3.CFrame = CFrame.new(35, 400.9, -40)
  90.  
  91. top1 = makebrick(model)
  92. top1.Name = "Top1"
  93. top1.BrickColor = BrickColor.new("Really black")
  94. top1.Size = Vector3.new(40, 1, 100)
  95. top1.CFrame = CFrame.new(-30, 419.9, 0)
  96.  
  97. top2 = makebrick(model)
  98. top2.Name = "Top2"
  99. top2.BrickColor = BrickColor.new("Really black")
  100. top2.Size = Vector3.new(40, 1, 100)
  101. top2.CFrame = CFrame.new(30, 419.9, 0)
  102.  
  103. top3 = makebrick(model)
  104. top3.Name = "Top3"
  105. top3.BrickColor = BrickColor.new("Really black")
  106. top3.Size = Vector3.new(20, 1, 40)
  107. top3.CFrame = CFrame.new(0, 419.9, 30)
  108.  
  109. top4 = makebrick(model)
  110. top4.Name = "Top4"
  111. top4.BrickColor = BrickColor.new("Really black")
  112. top4.Size = Vector3.new(20, 1, 40)
  113. top4.CFrame = CFrame.new(0, 419.9, -30)
  114.  
  115. top5 = makebrick(model)
  116. top5.Name = "Top5"
  117. top5.BrickColor = BrickColor.new("Really black")
  118. top5.Size = Vector3.new(50, 1, 100)
  119. top5.CFrame = CFrame.new(-25, 419.9 + 19, 0)
  120.  
  121. top6 = makebrick(model)
  122. top6.Name = "Top6"
  123. top6.BrickColor = BrickColor.new("Really black")
  124. top6.Size = Vector3.new(50, 1, 100)
  125. top6.CFrame = CFrame.new(25, 419.9 + 19, 0)
  126.  
  127. window1 = makebrick(model)
  128. window1.Name = "Windows"
  129. window1.BrickColor = BrickColor.new("Institutional white")
  130. window1.Size = Vector3.new(43, 18, 1)
  131. window1.CFrame = CFrame.new(27.5, 410.4, 49.5)
  132.  
  133. window2 = makebrick(model)
  134. window2.Name = "Windows"
  135. window2.BrickColor = BrickColor.new("Institutional white")
  136. window2.Size = Vector3.new(98, 18, 1)
  137. window2.CFrame = CFrame.new(0, 410.4, -49.5)
  138.  
  139. window3 = makebrick(model)
  140. window3.Name = "Windows"
  141. window3.BrickColor = BrickColor.new("Institutional white")
  142. window3.Size = Vector3.new(1, 18, 98)
  143. window3.CFrame = CFrame.new(49.5, 410.4, 0)
  144.  
  145. window4 = makebrick(model)
  146. window4.Name = "Windows"
  147. window4.BrickColor = BrickColor.new("Institutional white")
  148. window4.Size = Vector3.new(1, 18, 98)
  149. window4.CFrame = CFrame.new(-49.5, 410.4, 0)
  150.  
  151. window5 = makebrick(model)
  152. window5.Name = "Windows"
  153. window5.BrickColor = BrickColor.new("Institutional white")
  154. window5.Size = Vector3.new(10, 6, 1)
  155. window5.CFrame = CFrame.new(0, 416.4, 49.5)
  156.  
  157. window6 = makebrick(model)
  158. window6.Name = "Windows"
  159. window6.BrickColor = BrickColor.new("Institutional white")
  160. window6.Size = Vector3.new(43, 18, 1)
  161. window6.CFrame = CFrame.new(-27.5, 410.4, 49.5)
  162.  
  163. window7 = makebrick(model)
  164. window7.Name = "Windows"
  165. window7.BrickColor = BrickColor.new("Institutional white")
  166. window7.Size = Vector3.new(1, 18, 98)
  167. window7.CFrame = CFrame.new(49.5, 410.4 + 19, 0)
  168.  
  169. window8 = makebrick(model)
  170. window8.Name = "Windows"
  171. window8.BrickColor = BrickColor.new("Institutional white")
  172. window8.Size = Vector3.new(1, 18, 98)
  173. window8.CFrame = CFrame.new(-49.5, 410.4 + 19, 0)
  174.  
  175. window9 = makebrick(model)
  176. window9.Name = "Windows"
  177. window9.BrickColor = BrickColor.new("Institutional white")
  178. window9.Size = Vector3.new(98, 18, 1)
  179. window9.CFrame = CFrame.new(0, 410.4 + 19, 49.5)
  180.  
  181. window10 = makebrick(model)
  182. window10.Name = "Windows"
  183. window10.BrickColor = BrickColor.new("Institutional white")
  184. window10.Size = Vector3.new(98, 18, 1)
  185. window10.CFrame = CFrame.new(0, 410.4 + 19, -49.5)
  186.  
  187. si1 = makebrick(model)
  188. si1.BrickColor = BrickColor.new("Really black")
  189. si1.Size = Vector3.new(1, 18, 1)
  190. si1.CFrame = CFrame.new(5.5, 410.4, 49.5)
  191.  
  192. si2 = makebrick(model)
  193. si2.BrickColor = BrickColor.new("Really black")
  194. si2.Size = Vector3.new(1, 18, 1)
  195. si2.CFrame = CFrame.new(-49.5, 410.4, -49.5)
  196.  
  197. si3 = makebrick(model)
  198. si3.BrickColor = BrickColor.new("Really black")
  199. si3.Size = Vector3.new(1, 18, 1)
  200. si3.CFrame = CFrame.new(49.5, 410.4, -49.5)
  201.  
  202. si4 = makebrick(model)
  203. si4.BrickColor = BrickColor.new("Really black")
  204. si4.Size = Vector3.new(1, 18, 1)
  205. si4.CFrame = CFrame.new(49.5, 410.4, 49.5)
  206.  
  207. si5 = makebrick(model)
  208. si5.BrickColor = BrickColor.new("Really black")
  209. si5.Size = Vector3.new(10, 1, 1)
  210. si5.CFrame = CFrame.new(0, 412.9, 49.5)
  211.  
  212. si6 = makebrick(model)
  213. si6.BrickColor = BrickColor.new("Really black")
  214. si6.Size = Vector3.new(1, 18, 1)
  215. si6.CFrame = CFrame.new(-49.5, 410.4, 49.5)
  216.  
  217. si7 = makebrick(model)
  218. si7.BrickColor = BrickColor.new("Really black")
  219. si7.Size = Vector3.new(1, 18, 1)
  220. si7.CFrame = CFrame.new(-5.5, 410.4, 49.5)
  221.  
  222. si8 = makebrick(model)
  223. si8.BrickColor = BrickColor.new("Really black")
  224. si8.Size = Vector3.new(1, 18, 1)
  225. si8.CFrame = CFrame.new(49.5, 410.4 + 19, -49.5)
  226.  
  227. si9 = makebrick(model)
  228. si9.BrickColor = BrickColor.new("Really black")
  229. si9.Size = Vector3.new(1, 18, 1)
  230. si9.CFrame = CFrame.new(49.5, 410.4 + 19, 49.5)
  231.  
  232. si10 = makebrick(model)
  233. si10.BrickColor = BrickColor.new("Really black")
  234. si10.Size = Vector3.new(1, 18, 1)
  235. si10.CFrame = CFrame.new(-49.5, 410.4 + 19, 49.5)
  236.  
  237. si11 = makebrick(model)
  238. si11.BrickColor = BrickColor.new("Really black")
  239. si11.Size = Vector3.new(1, 18, 1)
  240. si11.CFrame = CFrame.new(-49.5, 410.4 + 19, -49.5)
  241.  
  242. script.Parent = model
  243. house2 = model
  244. dooropen = false
  245. eleing = false
  246. hatch = false
  247. bet, hot = "/", "close"
  248. hclose = true
  249. top = false
  250. etouch = true
  251. objects = house2:GetChildren()
  252. function findp(name)
  253. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  254. if string.lower(string.sub(v.Name,1,#name))==string.lower(name) then
  255. return v
  256. end
  257. end
  258. end
  259.  
  260. function onChatted(msg, speaker)
  261. for i,v in pairs(adminlist) do
  262. if speaker.Name == v then
  263.  
  264. if string.lower(msg) == "opendoor/" then
  265. if dooropen == false then
  266. local c = door.CFrame
  267. for i = 1, 11 do
  268. c = c * CFrame.new(0, 0.5, 0)
  269. door.Size = door.Size - Vector3.new(0, 1, 0)
  270. door.CFrame = c
  271. wait()
  272. end
  273.  
  274. c = deck1.CFrame
  275. c2 = deck2.CFrame
  276. c3 = deck3.CFrame
  277. for i = 1, 50 do
  278. c = c * CFrame.new(0, 0, 0.5)
  279. c2 = c2 * CFrame.new(-0.5, 0, 0)
  280. c3 = c3 * CFrame.new(0.5, 0, 0)
  281. deck1.Size = deck1.Size - Vector3.new(0, 0, -1)
  282. deck2.Size = deck2.Size - Vector3.new(-1, 0, 0)
  283. deck3.Size = deck3.Size - Vector3.new(-1, 0, 0)
  284. deck1.CFrame = c
  285. deck2.CFrame = c2
  286. deck3.CFrame = c3
  287. wait()
  288. end
  289. for i = 1, 102 do
  290. deck1.Size = deck1.Size + Vector3.new(1, 0, 0)
  291. deck1.CFrame = c
  292. wait()
  293. end
  294. dooropen = true
  295. end
  296.  
  297. elseif(string.lower(msg) == "touchon/") then
  298. etouch = true
  299.  
  300. elseif(string.lower(msg) == "touchoff/") then
  301. etouch = false
  302.  
  303. elseif(string.sub(string.lower(msg), 1, 3) == "in/") then
  304. local a = findp(string.sub(string.lower(msg), 4))
  305. if a ~= nil then
  306. if a.Character:findFirstChild("Torso") ~= nil then
  307. a.Character.Torso.CFrame = script.Parent.Bottom.CFrame + Vector3.new(0, 3.5, 0)
  308. end
  309. elseif(string.sub(string.lower(msg), 4) == "all") then
  310. for i,a in pairs(game.Players:GetPlayers()) do
  311. if a.Character:findFirstChild("Torso") ~= nil then
  312. a.Character.Torso.CFrame = script.Parent.Bottom.CFrame + Vector3.new(0, 3.5, 0)
  313. end
  314. end
  315. end
  316.  
  317. elseif(string.sub(string.lower(msg), 1, 4) == "out/") then
  318. local a = findp(string.sub(string.lower(msg), 5))
  319. if a ~= nil then
  320. if a.Character:findFirstChild("Torso") ~= nil then
  321. a.Character.Torso.CFrame = script.Parent.Bottom.CFrame - Vector3.new(0, 5, 0)
  322. end
  323. end
  324.  
  325. elseif(string.lower(msg) == "elevator/") then
  326. if eleing == false then
  327. eleing = true
  328. local c = e.CFrame
  329. for i = 1, 180 do
  330. c = c * CFrame.new(0, 0.1, 0)
  331. e.CFrame = c
  332. wait(0.1)
  333. end
  334. e.BrickColor = BrickColor.new("Bright blue")
  335. wait(4)
  336. e.BrickColor = BrickColor.new("Institutional white")
  337. local c = e.CFrame
  338. for i = 1, 180 do
  339. c = c * CFrame.new(0, -0.1, 0)
  340. e.CFrame = c
  341. wait()
  342. end
  343. eleing = false
  344. end
  345.  
  346. elseif(string.lower(msg) == "remove/") then
  347. model:remove()
  348.  
  349. elseif(string.lower(msg) == "lift/") then
  350. if eleing == false then
  351. eleing = true
  352. local c = e.CFrame
  353. for i = 1, 180 do
  354. c = c * CFrame.new(0, 0.1, 0)
  355. e.CFrame = c
  356. wait(0.1)
  357. end
  358. e.BrickColor = BrickColor.new("Bright blue")
  359. wait(4)
  360. e.BrickColor = BrickColor.new("Institutional white")
  361. local c = e.CFrame
  362. for i = 1, 180 do
  363. c = c * CFrame.new(0, -0.1, 0)
  364. e.CFrame = c
  365. wait()
  366. end
  367. eleing = false
  368. end
  369.  
  370. elseif(string.lower(msg) == "closedoor/") then
  371. if dooropen == true then
  372. local c = door.CFrame
  373. for i = 1, 11 do
  374. c = c * CFrame.new(0, -0.5, 0)
  375. door.Size = door.Size + Vector3.new(0, 1, 0)
  376. door.CFrame = c
  377. wait()
  378. end
  379.  
  380. local c = deck1.CFrame
  381. c2 = deck2.CFrame
  382. c3 = deck3.CFrame
  383.  
  384. for i = 1, 102 do
  385. deck1.Size = deck1.Size - Vector3.new(1, 0, 0)
  386. deck1.CFrame = c
  387. wait()
  388. end
  389.  
  390. for i = 1, 50 do
  391. c = c * CFrame.new(0, 0, -0.5)
  392. c2 = c2 * CFrame.new(0.5, 0, 0)
  393. c3 = c3 * CFrame.new(-0.5, 0, 0)
  394. deck1.Size = deck1.Size - Vector3.new(0, 0, 1)
  395. deck2.Size = deck2.Size - Vector3.new(1, 0, 0)
  396. deck3.Size = deck3.Size - Vector3.new(1, 0, 0)
  397. deck1.CFrame = c
  398. deck2.CFrame = c2
  399. deck3.CFrame = c3
  400. wait()
  401. end
  402. dooropen = false
  403. end
  404.  
  405. elseif string.sub(string.lower(msg),1,5) == "hatch" then
  406. local word = string.sub(string.lower(msg),6)
  407. if word == "open/" then
  408. if hclose == true then
  409. hclose = false
  410. hot = "opening"
  411. local p1,p2 = h3.CFrame,h4.CFrame
  412. for i=1, 100 do
  413. h3.Size = h3.Size - Vector3.new(0.1,0,0)
  414. h4.Size = h4.Size - Vector3.new(0.1,0,0)
  415. h3.CFrame = p1
  416. h4.CFrame = p2
  417. p1,p2 = p1 * CFrame.new(-0.05,0,0),p2 * CFrame.new(0.05,0,0)
  418. wait()
  419. end
  420. end
  421. hot = "open"
  422. elseif word == "close/" then
  423. if hclose == false then
  424. hclose = true
  425. hot = "closing"
  426. local p1,p2 = h3.CFrame,h4.CFrame
  427. for i=1, 100 do
  428. h3.Size = h3.Size - Vector3.new(-0.1,0,0)
  429. h4.Size = h4.Size - Vector3.new(-0.1,0,0)
  430. h3.CFrame = p1
  431. h4.CFrame = p2
  432. p1,p2 = p1 * CFrame.new(0.05,0,0),p2 * CFrame.new(-0.05,0,0)
  433. wait()
  434. end
  435. hot = "close"
  436. end
  437. end
  438.  
  439. elseif(string.sub(string.lower(msg), 1, 4) == "roof") then
  440. local word = string.sub(string.lower(msg),5)
  441. if word == "open/" then
  442. if hatch == false then
  443. hatch = true
  444. local p1,p2 = h1.CFrame,h2.CFrame
  445. for i=1, 100 do
  446. h1.Size = h1.Size - Vector3.new(0.1,0,0)
  447. h2.Size = h2.Size - Vector3.new(0.1,0,0)
  448. h1.CFrame = p1
  449. h2.CFrame = p2
  450. p1,p2 = p1 * CFrame.new(-0.05,0,0),p2 * CFrame.new(0.05,0,0)
  451. wait()
  452. end
  453. end
  454. elseif word == "close/" then
  455. if hatch == true then
  456. hatch = false
  457. local p1,p2 = h1.CFrame,h2.CFrame
  458. for i=1, 100 do
  459. h1.Size = h1.Size - Vector3.new(-0.1,0,0)
  460. h2.Size = h2.Size - Vector3.new(-0.1,0,0)
  461. h1.CFrame = p1
  462. h2.CFrame = p2
  463. p1,p2 = p1 * CFrame.new(0.05,0,0),p2 * CFrame.new(-0.05,0,0)
  464. wait()
  465. end
  466. end
  467. end
  468.  
  469. elseif(string.sub(string.lower(msg), 1, 3) == "top") then
  470. local word = string.sub(string.lower(msg),4)
  471. if word == "open/" then
  472. if top == false then
  473. top = true
  474. local p1,p2 = top5.CFrame,top6.CFrame
  475. for i=1, 500 do
  476. top5.Size = top5.Size - Vector3.new(0.1,0,0)
  477. top6.Size = top6.Size - Vector3.new(0.1,0,0)
  478. top5.CFrame = p1
  479. top6.CFrame = p2
  480. p1,p2 = p1 * CFrame.new(-0.05,0,0),p2 * CFrame.new(0.05,0,0)
  481. wait()
  482. end
  483. end
  484.  
  485. elseif word == "close/" then
  486. if top == true then
  487. top = false
  488. local p1,p2 = top5.CFrame,top6.CFrame
  489. for i=1, 500 do
  490. top5.Size = top5.Size - Vector3.new(-0.1,0,0)
  491. top6.Size = top6.Size - Vector3.new(-0.1,0,0)
  492. top5.CFrame = p1
  493. top6.CFrame = p2
  494. p1,p2 = p1 * CFrame.new(0.05,0,0),p2 * CFrame.new(-0.05,0,0)
  495. wait()
  496. end
  497. end
  498. end
  499.  
  500. elseif(string.lower(msg) == "windows/") then
  501. for i = 1, 7 do
  502. for i,v in pairs(script.Parent:GetChildren()) do
  503. if v.Name == "Windows" then
  504. v.Transparency = v.Transparency + 0.1
  505. end
  506. end
  507. wait()
  508. end
  509.  
  510. elseif(string.lower(msg) == "walls/") then
  511. for i = 1, 7 do
  512. for i,v in pairs(script.Parent:GetChildren()) do
  513. if v.Name == "Windows" then
  514. v.Transparency = v.Transparency - 0.1
  515. end
  516. end
  517. wait()
  518. end
  519.  
  520.  
  521. end
  522. end
  523. end
  524. end
  525.  
  526. game.Players.PlayerAdded:connect(function(p)
  527. p.Chatted:connect(function(msg) onChatted(msg, p) end)
  528. end)
  529.  
  530. for i,v in pairs(game.Players:GetPlayers()) do
  531. v.Chatted:connect(function(msg) onChatted(msg, v) end)
  532. end
  533.  
  534.  
  535. e.Touched:connect(function()
  536. if etouch == true then
  537. if eleing == false then
  538. eleing = true
  539. local c = e.CFrame
  540. for i = 1, 180 do
  541. c = c * CFrame.new(0, 0.1, 0)
  542. e.CFrame = c
  543. wait(0.1)
  544. end
  545. e.BrickColor = BrickColor.new("Bright blue")
  546. wait(4)
  547. e.BrickColor = BrickColor.new("Institutional white")
  548. local c = e.CFrame
  549. for i = 1, 180 do
  550. c = c * CFrame.new(0, -0.1, 0)
  551. e.CFrame = c
  552. wait()
  553. end
  554. eleing = false
  555. end
  556. end
  557. end)
  558.  
  559. game.DescendantRemoving:connect(function()
  560. house2.Parent = workspace
  561. for s=1, #objects do
  562. objects[s].Parent = house2
  563. end
  564. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement