Advertisement
Guest User

Untitled

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