Advertisement
ingfury

One Punch Steve [Edit of Steve script]

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