ManlyMemeScripter

Untitled

Feb 9th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.24 KB | None | 0 0
  1. --[[
  2.  
  3.  
  4.  
  5. ▓▒▒▓▓ ░▓▒▒██▒▒▓█▒▒▓▓ █▒▒▓█▒▒▒▒▒▒▒█▓▒▒▒▒▒▒▒█▒▓▒▒▒▒▒▓█▒▒▒▒▒▒▒█▓▒▒▒▓▒▒▓█▒▒▒▒▒▓▒▓░
  6. ▓ ░█▒ ▓░ ▓▓ ░█ ░█░▒ ▒▒ █░ █ ░ ▒▓ ▓▒ █ ░░
  7. ░░ ░ ▒██░░░ █░ ▓▓ ░░█░ ▓▒ ▒█████░ ▓█████░░ ▓▓ ░█ ▒█░█▓ ▒▓ ░███████▓ ██░
  8. ▓ ▓█▓ ▒▒█ █▒ ░█ ▓▒ ▒█████░ ▓█████░░ ▓▓ ░█ ▒█▓░ ░▓ ▓███████ █▓
  9. ▓ ░░ ▒█ █▒ ░ █░ ░░░░█░ ▓█████░ ▒██░ ▒██▒ ░█ ░ ░███ ▒░
  10. ▒░ ░░ ▓▓ █░ ▓▒ █░ ░░ ░█░ ▓█████░ █░ ░░ ░ █░ ░ ███░ ░▒
  11. ▒░ ▓▓ ▒▓ █░ ▒█ █▒ ░ █ ▓█████░ ▓ █░ ▒▓ █▒ ░ █▒ ▒█▓█████▓ ░▒
  12. ▒░▒░█▒▒█▓ █░ ▓█ ██░ ░ █░ ▓█████░ ▓█████░ ▒█ ░ █▒ ▒█ ░ █▒ ░███▓███▓░ ▒
  13. ░▒░ ▒█▓ ▒▒ ▒█░ ▓▓ ░██ ░▓ ▒ ░ █░ █░ ▒█ ▓▒ ░█ ▒▓ ███ ▓███░ ▒░
  14. ▒░ ░▓██▒░░ ▓▓ █▒ ▒██ ▓▓ ░ ░ ░█░ ░ █░ ▒█ ▓▓ █░ ▒█ █▓░ ░███▒ ░▒
  15. ▒▒ ▒███░▒ ░█ █▓ ░██░ ▒█ ░ █░ ░ █░ ▒█ █▒ ░█ ▓▓ ░█ ░██▓▒ ▓░
  16. ▒▒ ▒██▓▓▒ ▒▓ █░ ▓█▓ █░ ▒█░ █░ ▓▓ ░█░ ▓▒ ░█▒ ▓ ▓█▒░ ▒▒
  17. ▒▒░ █▓ ▓▒░▒█▒░░▓█░░▒█▒▒░░▓▓░▒▒▒░░▒█▒░░░░░░░█▒░▒█▓░░▓█▒░▒█░░░█▓░░▓▒ ▓█░░▒▒
  18. ░▒▒▒░ ▒░░▒▒░░░░░░░░ ▒░░░▒▒▒▒▒▒▒▒░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒░▒▒▒░░░░ ░░░▒░
  19. ASCII Art Generators are cool :)
  20.  
  21.  
  22.  
  23. ]]
  24.  
  25. -- Scroll down for changelog...
  26.  
  27. -- ORIGINAL CREATOR: Depr1
  28.  
  29. -- If this script isn't on pastebin or the user who uploaded this isn't called "Delros12"
  30. -- (and yes my pastebin account is Delros12) or the link is not https://pastebin.com/2NNDTLjL
  31. -- then this is not the original link of this script.
  32.  
  33. -- The original link of the script gets edited constantly for updates, if you use the original
  34. -- link you will be able to enjoy the most recent updates of this script without changing to
  35. -- another link which contains updated script.
  36.  
  37. -- Controls: Q to sneak, use the keypad numbers 1-9 to change blocks,
  38. -- choose a empty slot if you want to remove a block, E to open creative
  39. -- inventory, right-click to destroy a block in your toolbar in creative
  40. -- inventory.
  41.  
  42. -- You will become steve when you use this script, if you die after
  43. -- using this script, keep trying to use it or wait 60 seconds
  44. -- (it doesn't work at first but eventually it will)
  45.  
  46. -- Enjoy! :)
  47.  
  48. local updateHand = false
  49. local Changelog = [[
  50.  
  51. 05/02/2018:
  52. + Added gravity to sand and gravel.
  53.  
  54. 04/02/2018:
  55. + Added creative inventory.
  56. + Added 31 blocks (that's a lot, but not near minecraft's level).
  57. + Fixed a bug where the hand dissapears if u look down while sneaking.
  58. + Fixed? (not sure) a bug where if u ran the script you would die.
  59. + Added sprinting (i'll add footsteps and particles later).
  60. - Removed herobrine
  61.  
  62. 01/02/2018:
  63. + Added the hand that appears on minecraft when ur first person.
  64. + Added a walking animation to the hand.
  65. + Punching animation added to the hand.
  66. + Camera bobbing.
  67. + Sneaking now lowers your camera just like in minecraft.
  68. + Blocks now have sounds (i chose the ones that are the closest to minecraft sounds).
  69. + When a block is broken, particles will fall from it.
  70.  
  71. ]]
  72.  
  73. workspace:WaitForChild("Camera"):ClearAllChildren()
  74. local RS = game:GetService("RunService").RenderStepped
  75. local targetName = game.Players.LocalPlayer.Name
  76. local player = game.Players:FindFirstChild(targetName)
  77. local creativeInventory = {
  78. {
  79. name = "Dirt",
  80. size = Vector3.new(2.6, 2.6, 2.6),
  81. transparency = 0;
  82. frontTex = "rbxassetid://258733166",
  83. backTex = "rbxassetid://258733166",
  84. topTex = "rbxassetid://258733166",
  85. bottomTex = "rbxassetid://258733166",
  86. leftTex = "rbxassetid://258733166",
  87. rightTex = "rbxassetid://258733166",
  88. sound = "rbxassetid://324445205",
  89. soundVol = 1.25,
  90. hasGravity = false
  91. },
  92. {
  93. name = "Grass",
  94. size = Vector3.new(2.6, 2.6, 2.6),
  95. transparency = 0;
  96. frontTex = "rbxassetid://204974681",
  97. backTex = "rbxassetid://204974681",
  98. topTex = "rbxassetid://204974681",
  99. bottomTex = "rbxassetid://204974681",
  100. leftTex = "rbxassetid://204974681",
  101. rightTex = "rbxassetid://204974681",
  102. sound = "rbxassetid://193491628",
  103. soundVol = 1.25,
  104. hasGravity = false
  105. },
  106. {
  107. name = "Sand",
  108. size = Vector3.new(2.6, 2.6, 2.6),
  109. transparency = 0;
  110. frontTex = "rbxassetid://238182091",
  111. backTex = "rbxassetid://238182091",
  112. topTex = "rbxassetid://238182091",
  113. bottomTex = "rbxassetid://238182091",
  114. leftTex = "rbxassetid://238182091",
  115. rightTex = "rbxassetid://238182091",
  116. sound = "rbxassetid://171954017",
  117. soundVol = 1.25,
  118. hasGravity = true
  119. },
  120. {
  121. name = "Gravel",
  122. size = Vector3.new(2.6, 2.6, 2.6),
  123. transparency = 0;
  124. frontTex = "rbxassetid://51770076",
  125. backTex = "rbxassetid://51770076",
  126. topTex = "rbxassetid://51770076",
  127. bottomTex = "rbxassetid://51770076",
  128. leftTex = "rbxassetid://51770076",
  129. rightTex = "rbxassetid://51770076",
  130. sound = "rbxassetid://522675505",
  131. soundVol = 1.25,
  132. hasGravity = true
  133. },
  134. {
  135. name = "Stone",
  136. size = Vector3.new(2.6, 2.6, 2.6),
  137. transparency = 0;
  138. frontTex = "rbxassetid://75880927",
  139. backTex = "rbxassetid://75880927",
  140. topTex = "rbxassetid://75880927",
  141. bottomTex = "rbxassetid://75880927",
  142. leftTex = "rbxassetid://75880927",
  143. rightTex = "rbxassetid://75880927",
  144. sound = "rbxassetid://1016978163",
  145. soundVol = 2,
  146. hasGravity = false
  147. },
  148. {
  149. name = "Diamond Ore",
  150. size = Vector3.new(2.6, 2.6, 2.6),
  151. transparency = 0;
  152. frontTex = "rbxassetid://57928490",
  153. backTex = "rbxassetid://57928490",
  154. topTex = "rbxassetid://57928490",
  155. bottomTex = "rbxassetid://57928490",
  156. leftTex = "rbxassetid://57928490",
  157. rightTex = "rbxassetid://57928490",
  158. sound = "rbxassetid://1016978163",
  159. soundVol = 2,
  160. hasGravity = false
  161. },
  162. {
  163. name = "Diamond Block",
  164. size = Vector3.new(2.6, 2.6, 2.6),
  165. transparency = 0;
  166. frontTex = "rbxassetid://56749955",
  167. backTex = "rbxassetid://56749955",
  168. topTex = "rbxassetid://56749955",
  169. bottomTex = "rbxassetid://56749955",
  170. leftTex = "rbxassetid://56749955",
  171. rightTex = "rbxassetid://56749955",
  172. sound = "rbxassetid://1016978163",
  173. soundVol = 2,
  174. hasGravity = false
  175. },
  176. {
  177. name = "Emerald Block",
  178. size = Vector3.new(2.6, 2.6, 2.6),
  179. transparency = 0;
  180. frontTex = "rbxassetid://152410853",
  181. backTex = "rbxassetid://152410853",
  182. topTex = "rbxassetid://152410853",
  183. bottomTex = "rbxassetid://152410853",
  184. leftTex = "rbxassetid://152410853",
  185. rightTex = "rbxassetid://152410853",
  186. sound = "rbxassetid://1016978163",
  187. soundVol = 2,
  188. hasGravity = false
  189. },
  190. {
  191. name = "Emerald Ore",
  192. size = Vector3.new(2.6, 2.6, 2.6),
  193. transparency = 0;
  194. frontTex = "rbxassetid://152410868",
  195. backTex = "rbxassetid://152410868",
  196. topTex = "rbxassetid://152410868",
  197. bottomTex = "rbxassetid://152410868",
  198. leftTex = "rbxassetid://152410868",
  199. rightTex = "rbxassetid://152410868",
  200. sound = "rbxassetid://1016978163",
  201. soundVol = 2,
  202. hasGravity = false
  203. },
  204. {
  205. name = "Obsidian",
  206. size = Vector3.new(2.6, 2.6, 2.6),
  207. transparency = 0;
  208. frontTex = "rbxassetid://112560322",
  209. backTex = "rbxassetid://112560322",
  210. topTex = "rbxassetid://112560322",
  211. bottomTex = "rbxassetid://112560322",
  212. leftTex = "rbxassetid://112560322",
  213. rightTex = "rbxassetid://112560322",
  214. sound = "rbxassetid://1016978163",
  215. soundVol = 2,
  216. hasGravity = false
  217. },
  218. {
  219. name = "Gold Block",
  220. size = Vector3.new(2.6, 2.6, 2.6),
  221. transparency = 0;
  222. frontTex = "rbxassetid://152572128",
  223. backTex = "rbxassetid://152572128",
  224. topTex = "rbxassetid://152572128",
  225. bottomTex = "rbxassetid://152572128",
  226. leftTex = "rbxassetid://152572128",
  227. rightTex = "rbxassetid://152572128",
  228. sound = "rbxassetid://1016978163",
  229. soundVol = 2,
  230. hasGravity = false
  231. },
  232. {
  233. name = "Gold Ore",
  234. size = Vector3.new(2.6, 2.6, 2.6),
  235. transparency = 0;
  236. frontTex = "rbxassetid://152572121",
  237. backTex = "rbxassetid://152572121",
  238. topTex = "rbxassetid://152572121",
  239. bottomTex = "rbxassetid://152572121",
  240. leftTex = "rbxassetid://152572121",
  241. rightTex = "rbxassetid://152572121",
  242. sound = "rbxassetid://1016978163",
  243. soundVol = 2,
  244. hasGravity = false
  245. },
  246. {
  247. name = "Iron Block",
  248. size = Vector3.new(2.6, 2.6, 2.6),
  249. transparency = 0;
  250. frontTex = "rbxassetid://152572134",
  251. backTex = "rbxassetid://152572134",
  252. topTex = "rbxassetid://152572134",
  253. bottomTex = "rbxassetid://152572134",
  254. leftTex = "rbxassetid://152572134",
  255. rightTex = "rbxassetid://152572134",
  256. sound = "rbxassetid://1016978163",
  257. soundVol = 2,
  258. hasGravity = false
  259. },
  260. {
  261. name = "Iron Ore",
  262. size = Vector3.new(2.6, 2.6, 2.6),
  263. transparency = 0;
  264. frontTex = "rbxassetid://132879562",
  265. backTex = "rbxassetid://132879562",
  266. topTex = "rbxassetid://132879562",
  267. bottomTex = "rbxassetid://132879562",
  268. leftTex = "rbxassetid://132879562",
  269. rightTex = "rbxassetid://132879562",
  270. sound = "rbxassetid://1016978163",
  271. soundVol = 2,
  272. hasGravity = false
  273. },
  274. {
  275. name = "Redstone Block",
  276. size = Vector3.new(2.6, 2.6, 2.6),
  277. transparency = 0;
  278. frontTex = "rbxassetid://136260219",
  279. backTex = "rbxassetid://136260219",
  280. topTex = "rbxassetid://136260219",
  281. bottomTex = "rbxassetid://136260219",
  282. leftTex = "rbxassetid://136260219",
  283. rightTex = "rbxassetid://136260219",
  284. sound = "rbxassetid://1016978163",
  285. soundVol = 2,
  286. hasGravity = false
  287. },
  288. {
  289. name = "Redstone Ore",
  290. size = Vector3.new(2.6, 2.6, 2.6),
  291. transparency = 0;
  292. frontTex = "rbxassetid://152572209",
  293. backTex = "rbxassetid://152572209",
  294. topTex = "rbxassetid://152572209",
  295. bottomTex = "rbxassetid://152572209",
  296. leftTex = "rbxassetid://152572209",
  297. rightTex = "rbxassetid://152572209",
  298. sound = "rbxassetid://1016978163",
  299. soundVol = 2,
  300. hasGravity = false
  301. },
  302. {
  303. name = "Coal Block",
  304. size = Vector3.new(2.6, 2.6, 2.6),
  305. transparency = 0;
  306. frontTex = "rbxassetid://152527418",
  307. backTex = "rbxassetid://152527418",
  308. topTex = "rbxassetid://152527418",
  309. bottomTex = "rbxassetid://152527418",
  310. leftTex = "rbxassetid://152527418",
  311. rightTex = "rbxassetid://152527418",
  312. sound = "rbxassetid://1016978163",
  313. soundVol = 2,
  314. hasGravity = false
  315. },
  316. {
  317. name = "Coal Ore",
  318. size = Vector3.new(2.6, 2.6, 2.6),
  319. transparency = 0;
  320. frontTex = "rbxassetid://152572101",
  321. backTex = "rbxassetid://152572101",
  322. topTex = "rbxassetid://152572101",
  323. bottomTex = "rbxassetid://152572101",
  324. leftTex = "rbxassetid://152572101",
  325. rightTex = "rbxassetid://152572101",
  326. sound = "rbxassetid://1016978163",
  327. soundVol = 2,
  328. hasGravity = false
  329. },
  330. {
  331. name = "Bedrock",
  332. size = Vector3.new(2.6, 2.6, 2.6),
  333. transparency = 0;
  334. frontTex = "rbxassetid://75881126",
  335. backTex = "rbxassetid://75881126",
  336. topTex = "rbxassetid://75881126",
  337. bottomTex = "rbxassetid://75881126",
  338. leftTex = "rbxassetid://75881126",
  339. rightTex = "rbxassetid://75881126",
  340. sound = "rbxassetid://1016978163",
  341. soundVol = 2,
  342. hasGravity = false
  343. },
  344. {
  345. name = "Cobblestone",
  346. size = Vector3.new(2.6, 2.6, 2.6),
  347. transparency = 0;
  348. frontTex = "rbxassetid://152572105",
  349. backTex = "rbxassetid://152572105",
  350. topTex = "rbxassetid://152572105",
  351. bottomTex = "rbxassetid://152572105",
  352. leftTex = "rbxassetid://152572105",
  353. rightTex = "rbxassetid://152572105",
  354. sound = "rbxassetid://1016978163",
  355. soundVol = 2,
  356. hasGravity = false
  357. },
  358. {
  359. name = "Mossy Stone Brick",
  360. size = Vector3.new(2.6, 2.6, 2.6),
  361. transparency = 0;
  362. frontTex = "rbxassetid://61826751",
  363. backTex = "rbxassetid://61826751",
  364. topTex = "rbxassetid://61826751",
  365. bottomTex = "rbxassetid://61826751",
  366. leftTex = "rbxassetid://61826751",
  367. rightTex = "rbxassetid://61826751",
  368. sound = "rbxassetid://1016978163",
  369. soundVol = 2,
  370. hasGravity = false
  371. },
  372. {
  373. name = "Cracked Stone Brick",
  374. size = Vector3.new(2.6, 2.6, 2.6),
  375. transparency = 0;
  376. frontTex = "rbxassetid://151802087",
  377. backTex = "rbxassetid://151802087",
  378. topTex = "rbxassetid://151802087",
  379. bottomTex = "rbxassetid://151802087",
  380. leftTex = "rbxassetid://151802087",
  381. rightTex = "rbxassetid://151802087",
  382. sound = "rbxassetid://1016978163",
  383. soundVol = 2,
  384. hasGravity = false
  385. },
  386. {
  387. name = "Chiseled Stone Brick",
  388. size = Vector3.new(2.6, 2.6, 2.6),
  389. transparency = 0;
  390. frontTex = "rbxassetid://151802074",
  391. backTex = "rbxassetid://151802074",
  392. topTex = "rbxassetid://151802074",
  393. bottomTex = "rbxassetid://151802074",
  394. leftTex = "rbxassetid://151802074",
  395. rightTex = "rbxassetid://151802074",
  396. sound = "rbxassetid://1016978163",
  397. soundVol = 2,
  398. hasGravity = false
  399. },
  400. {
  401. name = "Stone Brick",
  402. size = Vector3.new(2.6, 2.6, 2.6),
  403. transparency = 0;
  404. frontTex = "rbxassetid://61826773",
  405. backTex = "rbxassetid://61826773",
  406. topTex = "rbxassetid://61826773",
  407. bottomTex = "rbxassetid://61826773",
  408. leftTex = "rbxassetid://61826773",
  409. rightTex = "rbxassetid://61826773",
  410. sound = "rbxassetid://1016978163",
  411. soundVol = 2,
  412. hasGravity = false
  413. },
  414. {
  415. name = "Nether Brick",
  416. size = Vector3.new(2.6, 2.6, 2.6),
  417. transparency = 0;
  418. frontTex = "rbxassetid://151802104",
  419. backTex = "rbxassetid://151802104",
  420. topTex = "rbxassetid://151802104",
  421. bottomTex = "rbxassetid://151802104",
  422. leftTex = "rbxassetid://151802104",
  423. rightTex = "rbxassetid://151802104",
  424. sound = "rbxassetid://1016978163",
  425. soundVol = 2,
  426. hasGravity = false
  427. },
  428. {
  429. name = "Granite",
  430. size = Vector3.new(2.6, 2.6, 2.6),
  431. transparency = 0;
  432. frontTex = "rbxassetid://151776467",
  433. backTex = "rbxassetid://151776467",
  434. topTex = "rbxassetid://151776467",
  435. bottomTex = "rbxassetid://151776467",
  436. leftTex = "rbxassetid://151776467",
  437. rightTex = "rbxassetid://151776467",
  438. sound = "rbxassetid://1016978163",
  439. soundVol = 2,
  440. hasGravity = false
  441. },
  442. {
  443. name = "Diorite",
  444. size = Vector3.new(2.6, 2.6, 2.6),
  445. transparency = 0;
  446. frontTex = "rbxassetid://151776452",
  447. backTex = "rbxassetid://151776452",
  448. topTex = "rbxassetid://151776452",
  449. bottomTex = "rbxassetid://151776452",
  450. leftTex = "rbxassetid://151776452",
  451. rightTex = "rbxassetid://151776452",
  452. sound = "rbxassetid://1016978163",
  453. soundVol = 2,
  454. hasGravity = false
  455. },
  456. {
  457. name = "Andesite",
  458. size = Vector3.new(2.6, 2.6, 2.6),
  459. transparency = 0;
  460. frontTex = "rbxassetid://151776422",
  461. backTex = "rbxassetid://151776422",
  462. topTex = "rbxassetid://151776422",
  463. bottomTex = "rbxassetid://151776422",
  464. leftTex = "rbxassetid://151776422",
  465. rightTex = "rbxassetid://151776422",
  466. sound = "rbxassetid://1016978163",
  467. soundVol = 2,
  468. hasGravity = false
  469. },
  470. {
  471. name = "Polished Granite",
  472. size = Vector3.new(2.6, 2.6, 2.6),
  473. transparency = 0;
  474. frontTex = "rbxassetid://151776506",
  475. backTex = "rbxassetid://151776506",
  476. topTex = "rbxassetid://151776506",
  477. bottomTex = "rbxassetid://151776506",
  478. leftTex = "rbxassetid://151776506",
  479. rightTex = "rbxassetid://151776506",
  480. sound = "rbxassetid://1016978163",
  481. soundVol = 2,
  482. hasGravity = false
  483. },
  484. {
  485. name = "Polished Diorite",
  486. size = Vector3.new(2.6, 2.6, 2.6),
  487. transparency = 0;
  488. frontTex = "rbxassetid://151776533",
  489. backTex = "rbxassetid://151776533",
  490. topTex = "rbxassetid://151776533",
  491. bottomTex = "rbxassetid://151776533",
  492. leftTex = "rbxassetid://151776533",
  493. rightTex = "rbxassetid://151776533",
  494. sound = "rbxassetid://1016978163",
  495. soundVol = 2,
  496. hasGravity = false
  497. },
  498. {
  499. name = "Polished Andesite",
  500. size = Vector3.new(2.6, 2.6, 2.6),
  501. transparency = 0;
  502. frontTex = "rbxassetid://151776506",
  503. backTex = "rbxassetid://151776506",
  504. topTex = "rbxassetid://151776506",
  505. bottomTex = "rbxassetid://151776506",
  506. leftTex = "rbxassetid://151776506",
  507. rightTex = "rbxassetid://151776506",
  508. sound = "rbxassetid://1016978163",
  509. soundVol = 2,
  510. hasGravity = false
  511. },
  512. {
  513. name = "Brick Block",
  514. size = Vector3.new(2.6, 2.6, 2.6),
  515. transparency = 0;
  516. frontTex = "rbxassetid://59389191",
  517. backTex = "rbxassetid://59389191",
  518. topTex = "rbxassetid://59389191",
  519. bottomTex = "rbxassetid://59389191",
  520. leftTex = "rbxassetid://59389191",
  521. rightTex = "rbxassetid://59389191",
  522. sound = "rbxassetid://1016978163",
  523. soundVol = 2,
  524. hasGravity = false
  525. },
  526. {
  527. name = "Packed Ice",
  528. size = Vector3.new(2.6, 2.6, 2.6),
  529. transparency = 0;
  530. frontTex = "rbxassetid://152528023",
  531. backTex = "rbxassetid://152528023",
  532. topTex = "rbxassetid://152528023",
  533. bottomTex = "rbxassetid://152528023",
  534. leftTex = "rbxassetid://152528023",
  535. rightTex = "rbxassetid://152528023",
  536. sound = "rbxassetid://1016978163",
  537. soundVol = 2,
  538. hasGravity = false
  539. },
  540. {
  541. name = "Ice Block",
  542. size = Vector3.new(2.6, 2.6, 2.6),
  543. transparency = 1;
  544. frontTex = "rbxassetid://118555586",
  545. backTex = "rbxassetid://118555586",
  546. topTex = "rbxassetid://118555586",
  547. bottomTex = "rbxassetid://118555586",
  548. leftTex = "rbxassetid://118555586",
  549. rightTex = "rbxassetid://118555586",
  550. sound = "rbxassetid://1016978163",
  551. soundVol = 2,
  552. hasGravity = false
  553. },
  554. {
  555. name = "Netherrack",
  556. size = Vector3.new(2.6, 2.6, 2.6),
  557. transparency = 0;
  558. frontTex = "rbxassetid://151802119",
  559. backTex = "rbxassetid://151802119",
  560. topTex = "rbxassetid://151802119",
  561. bottomTex = "rbxassetid://151802119",
  562. leftTex = "rbxassetid://151802119",
  563. rightTex = "rbxassetid://151802119",
  564. sound = "rbxassetid://1016978163",
  565. soundVol = 2,
  566. hasGravity = false
  567. },
  568. {
  569. name = "End Stone",
  570. size = Vector3.new(2.6, 2.6, 2.6),
  571. transparency = 0;
  572. frontTex = "rbxassetid://151802091",
  573. backTex = "rbxassetid://151802091",
  574. topTex = "rbxassetid://151802091",
  575. bottomTex = "rbxassetid://151802091",
  576. leftTex = "rbxassetid://151802091",
  577. rightTex = "rbxassetid://151802091",
  578. sound = "rbxassetid://1016978163",
  579. soundVol = 2,
  580. hasGravity = false
  581. },
  582. {
  583. name = "Glass Block",
  584. size = Vector3.new(2.6, 2.6, 2.6),
  585. transparency = 1;
  586. frontTex = "rbxassetid://152239003",
  587. backTex = "rbxassetid://152239003",
  588. topTex = "rbxassetid://152239003",
  589. bottomTex = "rbxassetid://152239003",
  590. leftTex = "rbxassetid://152239003",
  591. rightTex = "rbxassetid://152239003",
  592. sound = "rbxassetid://1016978163",
  593. soundVol = 2,
  594. hasGravity = false
  595. },
  596. {
  597. name = "Glowstone",
  598. size = Vector3.new(2.6, 2.6, 2.6),
  599. transparency = 0;
  600. frontTex = "rbxassetid://54790811",
  601. backTex = "rbxassetid://54790811",
  602. topTex = "rbxassetid://54790811",
  603. bottomTex = "rbxassetid://54790811",
  604. leftTex = "rbxassetid://54790811",
  605. rightTex = "rbxassetid://54790811",
  606. sound = "rbxassetid://1016978163",
  607. soundVol = 2,
  608. hasGravity = false
  609. },
  610. {
  611. name = "Bookshelf",
  612. size = Vector3.new(2.6, 2.6, 2.6),
  613. transparency = 0;
  614. frontTex = "rbxassetid://118554092",
  615. backTex = "rbxassetid://118554092",
  616. topTex = "rbxassetid://346201871",
  617. bottomTex = "rbxassetid://346201871",
  618. leftTex = "rbxassetid://118554092",
  619. rightTex = "rbxassetid://118554092",
  620. sound = "rbxassetid://507863457",
  621. soundVol = 2,
  622. hasGravity = false
  623. },
  624. {
  625. name = "Oak Wood Planks",
  626. size = Vector3.new(2.6, 2.6, 2.6),
  627. transparency = 0;
  628. frontTex = "rbxassetid://346201871",
  629. backTex = "rbxassetid://346201871",
  630. topTex = "rbxassetid://346201871",
  631. bottomTex = "rbxassetid://346201871",
  632. leftTex = "rbxassetid://346201871",
  633. rightTex = "rbxassetid://346201871",
  634. sound = "rbxassetid://507863457",
  635. soundVol = 2,
  636. hasGravity = false
  637. },
  638. {
  639. name = "Oak Log",
  640. size = Vector3.new(2.6, 2.6, 2.6),
  641. transparency = 0;
  642. frontTex = "rbxassetid://71445924",
  643. backTex = "rbxassetid://71445924",
  644. topTex = "rbxassetid://152538557",
  645. bottomTex = "rbxassetid://152538557",
  646. leftTex = "rbxassetid://71445924",
  647. rightTex = "rbxassetid://71445924",
  648. sound = "rbxassetid://507863457",
  649. soundVol = 2,
  650. hasGravity = false
  651. },
  652. {
  653. name = "Oak Leaves",
  654. size = Vector3.new(2.6, 2.6, 2.6),
  655. transparency = 1;
  656. frontTex = "rbxassetid://151708391",
  657. backTex = "rbxassetid://151708391",
  658. topTex = "rbxassetid://151708391",
  659. bottomTex = "rbxassetid://151708391",
  660. leftTex = "rbxassetid://151708391",
  661. rightTex = "rbxassetid://151708391",
  662. sound = "rbxassetid://507863457",
  663. -- couldn't find a leaves sound for this one, sorry lol
  664. soundVol = 2,
  665. hasGravity = false
  666. }
  667. }
  668. local toolBar = {
  669. {
  670. name = "Dirt Block",
  671. size = Vector3.new(2.6, 2.6, 2.6),
  672. transparency = 0;
  673. frontTex = "rbxassetid://152569532",
  674. backTex = "rbxassetid://152569532",
  675. topTex = "rbxassetid://152569532",
  676. bottomTex = "rbxassetid://152569532",
  677. leftTex = "rbxassetid://152569532",
  678. rightTex = "rbxassetid://152569532",
  679. sound = "rbxassetid://1102186681",
  680. soundVol = 1.25,
  681. hasGravity = false
  682. },
  683. {
  684. name = "Grass Block",
  685. size = Vector3.new(2.6, 2.6, 2.6),
  686. transparency = 0;
  687. frontTex = "rbxassetid://96430337",
  688. backTex = "rbxassetid://96430337",
  689. topTex = "rbxassetid://96430265",
  690. bottomTex = "rbxassetid://179655033",
  691. leftTex = "rbxassetid://96430337",
  692. rightTex = "rbxassetid://96430337",
  693. sound = "rbxassetid://1102186681",
  694. soundVol = 1.25,
  695. hasGravity = false
  696. },
  697. {
  698. name = "Stone",
  699. size = Vector3.new(2.6, 2.6, 2.6),
  700. transparency = 0;
  701. frontTex = "rbxassetid://75880927",
  702. backTex = "rbxassetid://75880927",
  703. topTex = "rbxassetid://75880927",
  704. bottomTex = "rbxassetid://75880927",
  705. leftTex = "rbxassetid://75880927",
  706. rightTex = "rbxassetid://75880927",
  707. sound = "rbxassetid://1016978163",
  708. soundVol = 2,
  709. hasGravity = false
  710. },
  711. {
  712. name = "Diamond Ore",
  713. size = Vector3.new(2.6, 2.6, 2.6),
  714. transparency = 0;
  715. frontTex = "rbxassetid://57928490",
  716. backTex = "rbxassetid://57928490",
  717. topTex = "rbxassetid://57928490",
  718. bottomTex = "rbxassetid://57928490",
  719. leftTex = "rbxassetid://57928490",
  720. rightTex = "rbxassetid://57928490",
  721. sound = "rbxassetid://1016978163",
  722. soundVol = 2,
  723. hasGravity = false
  724. },
  725. {
  726. name = "Diamond Block",
  727. size = Vector3.new(2.6, 2.6, 2.6),
  728. transparency = 0;
  729. frontTex = "rbxassetid://56749955",
  730. backTex = "rbxassetid://56749955",
  731. topTex = "rbxassetid://56749955",
  732. bottomTex = "rbxassetid://56749955",
  733. leftTex = "rbxassetid://56749955",
  734. rightTex = "rbxassetid://56749955",
  735. sound = "rbxassetid://1016978163",
  736. soundVol = 2,
  737. hasGravity = false
  738. },
  739. {
  740. name = "Oak Wood Planks",
  741. size = Vector3.new(2.6, 2.6, 2.6),
  742. transparency = 0;
  743. frontTex = "rbxassetid://346201871",
  744. backTex = "rbxassetid://346201871",
  745. topTex = "rbxassetid://346201871",
  746. bottomTex = "rbxassetid://346201871",
  747. leftTex = "rbxassetid://346201871",
  748. rightTex = "rbxassetid://346201871",
  749. sound = "rbxassetid://507863457",
  750. soundVol = 2,
  751. hasGravity = false
  752. },
  753. {
  754. name = "Oak Log",
  755. size = Vector3.new(2.6, 2.6, 2.6),
  756. transparency = 0;
  757. frontTex = "rbxassetid://71445924",
  758. backTex = "rbxassetid://71445924",
  759. topTex = "rbxassetid://152538557",
  760. bottomTex = "rbxassetid://152538557",
  761. leftTex = "rbxassetid://71445924",
  762. rightTex = "rbxassetid://71445924",
  763. sound = "rbxassetid://507863457",
  764. soundVol = 2,
  765. hasGravity = false
  766. }
  767. }
  768. function putTexture(part, frontF, backF, topF, bottomF, leftF, rightF, className)
  769. local faces = {"Front", "Back", "Top", "Bottom", "Left", "Right"}
  770. for i,f in pairs(faces) do
  771. local decal = Instance.new(className, part)
  772. if i == 1 then decal.Texture = frontF decal.Name = f end
  773. if i == 2 then decal.Texture = backF or frontF decal.Name = f end
  774. if i == 3 then decal.Texture = topF or frontF decal.Name = f end
  775. if i == 4 then decal.Texture = bottomF or frontF decal.Name = f end
  776. if i == 5 then decal.Texture = leftF or frontF decal.Name = f end
  777. if i == 6 then decal.Texture = rightF or frontF decal.Name = f end
  778. decal.Face = f
  779. end
  780. return part
  781. end
  782. function makeSquare(position, size, color, transparency, parent, zindex)
  783. local label = Instance.new("TextLabel", parent)
  784. label.Text = ""
  785. label.BorderSizePixel = 0
  786. label.BackgroundTransparency = transparency
  787. label.Position = position
  788. label.Size = size
  789. label.BackgroundColor3 = color
  790. if zindex == nil then label.ZIndex = 1 else label.ZIndex = zindex end
  791. return label
  792. end
  793. function putInventorySlot(position, image, parent, zindex)
  794. local button = Instance.new("TextButton", parent)
  795. button.Position = position
  796. button.Size = UDim2.new(0, 36, 0, 36)
  797. button.BackgroundColor3 = Color3.new(139/255, 139/255, 139/255)
  798. button.Text = ""
  799. button.BorderSizePixel = 0
  800. button.ZIndex = zindex
  801. local imageLabel = Instance.new("ImageLabel", button)
  802. imageLabel.BackgroundTransparency = 0.9
  803. imageLabel.Position = UDim2.new(0, 2, 0, 2)
  804. imageLabel.Size = UDim2.new(0, 32, 0, 32)
  805. imageLabel.Image = image
  806. imageLabel.BorderSizePixel = 0
  807. imageLabel.ZIndex = zindex
  808. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 34, 0, 2),
  809. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  810. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 34),
  811. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  812. makeSquare(UDim2.new(0, 34, 0, 2), UDim2.new(0, 2, 0, 34),
  813. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  814. makeSquare(UDim2.new(0, 2, 0, 34), UDim2.new(0, 34, 0, 2),
  815. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  816. return button
  817. end
  818.  
  819. local draggingBlock = nil
  820. function makeInventory()
  821. local playerGui = player:FindFirstChild("PlayerGui")
  822. if playerGui then
  823. local invGui = Instance.new("ScreenGui", playerGui)
  824. local creativeInv = Instance.new("Frame", invGui)
  825. creativeInv.BackgroundTransparency = 1
  826. creativeInv.Position = UDim2.new(0.5, -170, 0.5, -202)
  827.  
  828. creativeInv.Visible = false
  829.  
  830. -- creative inventory GUI...
  831.  
  832. local blackOut = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(1, 0, 1, 0),
  833. Color3.new(0/255, 0/255, 0/255), 0.3, invGui, 1)
  834. blackOut.Visible = false
  835.  
  836. creativeInv.Changed:connect(function()
  837. blackOut.Visible = creativeInv.Visible
  838. end)
  839.  
  840. makeSquare(UDim2.new(0, -2, 0, 2), UDim2.new(0, 340, 0, 404),
  841. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 3)
  842. makeSquare(UDim2.new(0, 338, 0, 0), UDim2.new(0, 6, 0, 406),
  843. Color3.new(85/255, 85/255, 85/255), 0, creativeInv, 2)
  844. makeSquare(UDim2.new(0, 0, 0, 404), UDim2.new(0, 342, 0, 4),
  845. Color3.new(85/255, 85/255, 85/255), 0, creativeInv, 3)
  846. makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 338, 0, 402),
  847. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 3)
  848. makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 4, 0, 406),
  849. Color3.new(255/255, 255/255, 255/255), 0, creativeInv, 3)
  850. makeSquare(UDim2.new(0, -2, 0, -4), UDim2.new(0, 342, 0, 6),
  851. Color3.new(255/255, 255/255, 255/255), 0, creativeInv, 2)
  852. makeSquare(UDim2.new(0, 340, 0, -2), UDim2.new(0, 2, 0, 2),
  853. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 2)
  854. makeSquare(UDim2.new(0, 340, 0, -4), UDim2.new(0, 2, 0, 4),
  855. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  856. makeSquare(UDim2.new(0, 342, 0, -2), UDim2.new(0, 2, 0, 2),
  857. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  858. makeSquare(UDim2.new(0, 344, 0, 0), UDim2.new(0, 2, 0, 406),
  859. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  860. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 2, 0, 4),
  861. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  862. makeSquare(UDim2.new(0, -2, 0, -6), UDim2.new(0, 342, 0, 4),
  863. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  864. makeSquare(UDim2.new(0, 0, 0, 406), UDim2.new(0, 342, 0, 4),
  865. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  866. makeSquare(UDim2.new(0, 342, 0, 404), UDim2.new(0, 2, 0, 4),
  867. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  868. makeSquare(UDim2.new(0, -4, 0, 404), UDim2.new(0, 2, 0, 2),
  869. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  870. makeSquare(UDim2.new(0, -2, 0, 406), UDim2.new(0, 2, 0, 2),
  871. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  872. makeSquare(UDim2.new(0, -6, 0, -2), UDim2.new(0, 2, 0, 406),
  873. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  874. 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)
  875. text.Text = "Creative Inventory"
  876. text.Font = "SourceSansSemibold"
  877. text.TextSize = 14
  878. text.TextXAlignment = "Left"
  879. --
  880. local draggingBlockPicture = Instance.new("ImageLabel", invGui)
  881. draggingBlockPicture.BackgroundTransparency = 1
  882. draggingBlockPicture.Size = UDim2.new(0, 32, 0, 32)
  883. draggingBlockPicture.ZIndex = 5
  884. coroutine.resume(coroutine.create(function()
  885. local invMouse = player:GetMouse()
  886. --local RS = game:GetService("RunService").RenderStepped
  887. invMouse.Button2Down:connect(function()
  888. draggingBlock = nil
  889. end)
  890. while RS:wait() do
  891. draggingBlockPicture.Position = UDim2.new(0, invMouse.X - 16, 0, invMouse.Y - 16)
  892. if draggingBlock ~= nil then
  893. draggingBlockPicture.Image = draggingBlock.frontTex
  894. else
  895. draggingBlockPicture.Image = ""
  896. end
  897. end
  898. end))
  899.  
  900. local done = false
  901. local x = 0
  902. local y = 0
  903.  
  904. for i,b in pairs(creativeInventory) do
  905. putInventorySlot(UDim2.new(0.5, (x*36) + 8, 0.5, (y*36) + 28), b.frontTex, creativeInv, 4).MouseButton1Down:connect(function()
  906. if draggingBlock == nil then
  907. draggingBlock = b
  908. end
  909. end)
  910. x = x + 1
  911. if x >= 8 then
  912. x = 0
  913. y = y + 1
  914. end
  915. end
  916. if x == 0 then done = true end
  917. while x < 8 and done == false do
  918. putInventorySlot(UDim2.new(0.5, (x*36) + 8, 0.5, (y*36) + 28), "", creativeInv, 4)
  919. x = x + 1
  920. end
  921. for i = 1, 9 do
  922. if toolBar[i] ~= nil then
  923. local invSlot = putInventorySlot(UDim2.new(0, 8 + ((i-1)*36), 0, 360), toolBar[i].frontTex, creativeInv, 4)
  924. invSlot.MouseButton2Down:connect(function()
  925. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  926. if imgLabel then
  927. toolBar[i] = nil
  928. imgLabel.Image = ""
  929. end
  930. end)
  931. invSlot.MouseButton1Down:connect(function()
  932. --updateHand = true
  933. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  934. if toolBar[i] == nil then
  935. toolBar[i] = draggingBlock
  936. imgLabel.Image = draggingBlock.frontTex
  937. draggingBlock = nil
  938. return
  939. end
  940. if toolBar[i] ~= nil and draggingBlock == nil then
  941. draggingBlock = toolBar[i]
  942. toolBar[i] = nil
  943. imgLabel.Image = ""
  944. return
  945. elseif toolBar[i] ~= nil and draggingBlock ~= nil then
  946. --draggingBlock = toolBar[i]
  947. --toolBar[i] = nil
  948. imgLabel.Image = ""
  949. local temp = toolBar[i]
  950. toolBar[i] = draggingBlock
  951. if imgLabel and draggingBlock ~= nil then
  952. imgLabel.Image = draggingBlock.frontTex
  953. end
  954. if imgLabel and draggingBlock == nil then
  955. imgLabel.Image = ""
  956. end
  957. draggingBlock = temp
  958. return
  959. end
  960. end)
  961. else
  962. local invSlot = putInventorySlot(UDim2.new(0, 8 + ((i-1)*36), 0, 360), "", creativeInv, 4)
  963. invSlot.MouseButton2Down:connect(function()
  964. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  965. if imgLabel then
  966. toolBar[i] = nil
  967. imgLabel.Image = ""
  968. end
  969. end)
  970. invSlot.MouseButton1Down:connect(function()
  971. --updateHand = true
  972. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  973. if toolBar[i] == nil then
  974. toolBar[i] = draggingBlock
  975. imgLabel.Image = draggingBlock.frontTex
  976. draggingBlock = nil
  977. return
  978. end
  979. if toolBar[i] ~= nil and draggingBlock == nil then
  980. draggingBlock = toolBar[i]
  981. toolBar[i] = nil
  982. imgLabel.Image = ""
  983. return
  984. elseif toolBar[i] ~= nil and draggingBlock ~= nil then
  985. --draggingBlock = toolBar[i]
  986. --toolBar[i] = nil
  987. imgLabel.Image = ""
  988. local temp = toolBar[i]
  989. toolBar[i] = draggingBlock
  990. if imgLabel and draggingBlock ~= nil then
  991. imgLabel.Image = draggingBlock.frontTex
  992. end
  993. if imgLabel and draggingBlock == nil then
  994. imgLabel.Image = ""
  995. end
  996. draggingBlock = temp
  997. return
  998. end
  999. end)
  1000. end
  1001. end
  1002. return creativeInv
  1003. end
  1004. end
  1005. function putToolBarSlot(position, image, zindex)
  1006. local playerGui = player:FindFirstChild("PlayerGui")
  1007. if playerGui then
  1008. local gui = playerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", playerGui)
  1009. gui.Name = "ToolBar"
  1010. local slot = Instance.new("ImageLabel", gui)
  1011. slot.Position = position
  1012. slot.Size = UDim2.new(0, 32, 0, 32)
  1013. slot.BackgroundTransparency = 1
  1014. slot.ImageTransparency = 0
  1015. slot.Image = image
  1016. slot.ZIndex = 2
  1017.  
  1018. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 32, 0, 32),
  1019. Color3.new(95/255, 89/255, 76/255), 0, slot)
  1020. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 32),
  1021. Color3.new(0/255, 0/255, 0/255), 0.5, slot)
  1022. makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 30, 0, 2),
  1023. Color3.new(0/255, 0/255, 0/255), 0.5, slot)
  1024. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 36, 0, 2),
  1025. Color3.new(106/255, 106/255, 106/255), 0, slot)
  1026. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 2, 0, 36),
  1027. Color3.new(106/255, 106/255, 106/255), 0, slot)
  1028. makeSquare(UDim2.new(0, 0, 0, 32), UDim2.new(0, 34, 0, 2),
  1029. Color3.new(130/255, 130/255, 130/255), 0, slot)
  1030. makeSquare(UDim2.new(0, 32, 0, 0), UDim2.new(0, 2, 0, 34),
  1031. Color3.new(130/255, 130/255, 130/255), 0, slot)
  1032. makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 2, 0, 38),
  1033. Color3.new(130/255, 130/255, 130/255), 0, slot)
  1034. makeSquare(UDim2.new(0, 34, 0, -2), UDim2.new(0, 2, 0, 36),
  1035. Color3.new(106/255, 106/255, 106/255), 0, slot)
  1036. makeSquare(UDim2.new(0, -2, 0, 34), UDim2.new(0, 38, 0, 2),
  1037. Color3.new(106/255, 106/255, 106/255), 0, slot)
  1038. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 40, 0, 2),
  1039. Color3.new(156/255, 156/255, 156/255), 0, slot)
  1040. return slot
  1041. end
  1042. end
  1043. function divide(x, d)
  1044. if x ~= 0 and d ~= 0 then
  1045. return x/d
  1046. else
  1047. return x
  1048. end
  1049. end -- so it doesn't divide by zero
  1050. function getDistance(v1, v2)
  1051. return math.abs((Vector3.new(math.abs(v2.X - v1.X), math.abs(v2.Y - v1.Y), math.abs(v2.Z - v1.Z))).Magnitude)
  1052. end
  1053. function round(x)
  1054. if x%2 ~= 0.5 then
  1055. return math.floor(x+0.5)
  1056. end
  1057. return x-0.5
  1058. end
  1059. function weldTo(part1, part2)
  1060. local weld = Instance.new("Weld", part1)
  1061. weld.Part0 = part1
  1062. weld.Part1 = part2
  1063. end
  1064. function getMagnitudeXZ(velocity)
  1065. return math.abs(velocity.X) + math.abs(velocity.Z)
  1066. end
  1067. function findHumanoid(inst)
  1068. local find = inst
  1069. local hum = nil
  1070. repeat
  1071. if find.Name == "Workspace" then return nil end
  1072. find = find.Parent
  1073. hum = find:FindFirstChild("Humanoid")
  1074. until hum
  1075. --if hum then print("found!!") else print("aw... not found") end
  1076. --if hum.ClassName ~= "Humanoid" then hum = nil end
  1077. return hum
  1078. end
  1079. function placeBlock(block, cFPos, Mouse)
  1080. if block == nil then
  1081. if Mouse.Target.Size.X <= 10 and Mouse.Target.Size.Y <= 10 and Mouse.Target.Size.Z <= 10 and Mouse.Target then
  1082. if Mouse.Target.Parent.Name ~= "Camera" then
  1083. --print(Mouse.Target:GetFullName())
  1084. local blkTar = Mouse.Target
  1085. --Mouse.Target.Parent = nil
  1086. for i = 1, 9 do
  1087. local part = Instance.new("Part", workspace)
  1088. part.Size = Vector3.new(0, 0, 0)
  1089. part.Transparency = 1
  1090. part.CanCollide = false
  1091. part.Velocity = Vector3.new(math.random(-5, 5), 5, math.random(-5, 5))
  1092. part.Name = "Debris"
  1093.  
  1094. part.CFrame =
  1095. Mouse.Target.CFrame *
  1096. 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))
  1097.  
  1098. local billboard = Instance.new("BillboardGui", part)
  1099. billboard.Size = UDim2.new(1.2, 0, 1.2, 0)
  1100.  
  1101. local clipDescendant = Instance.new("TextLabel", billboard)
  1102. clipDescendant.Size = UDim2.new(0.5, 0, 0.5, 0)
  1103. clipDescendant.BackgroundTransparency = 1
  1104. clipDescendant.Text = ""
  1105. clipDescendant.ClipsDescendants = true
  1106.  
  1107. local img = Instance.new("ImageLabel", clipDescendant)
  1108. img.Size = UDim2.new(2, 0, 2, 0)
  1109. img.BackgroundTransparency = 1
  1110. img.Position = UDim2.new((math.random(0, 100)-50)/100, 0, (math.random(0, 100)-50)/100, 0)
  1111.  
  1112. local tex = blkTar:FindFirstChild("Front")
  1113. if tex then
  1114. img.Image = tex.Texture
  1115. else
  1116. img.Image = "rbxassetid://744949545"
  1117. end
  1118.  
  1119. if img.Image == "rbxassetid://744949545" then
  1120. img.ImageColor3 = blkTar.Color
  1121. end
  1122.  
  1123. part.Touched:connect(function(prt)
  1124. if prt ~= blkTar then
  1125. part.CanCollide = true
  1126. end
  1127. end)
  1128.  
  1129. coroutine.resume(coroutine.create(function()
  1130. wait(math.random(50, 65)/100)
  1131. part:Destroy()
  1132. end))
  1133. --part.Anchored = false
  1134. end
  1135. blkTar:Destroy()
  1136. end
  1137. end
  1138. return nil
  1139. else
  1140. local blockPlaced = Instance.new("Part", workspace)
  1141. blockPlaced.Material = "Fabric"
  1142. blockPlaced.Transparency = block.transparency
  1143. blockPlaced.Anchored = true
  1144. blockPlaced.Size = block.size
  1145. blockPlaced.CFrame = cFPos
  1146. blockPlaced.Name = block.name
  1147. putTexture(blockPlaced, block.frontTex, block.backTex,
  1148. block.topTex, block.bottomTex, block.leftTex, block.rightTex, "Texture")
  1149.  
  1150. if block.hasGravity == true then
  1151. local connectedTo = Instance.new("ObjectValue", blockPlaced)
  1152. connectedTo.Name = "ConnectedTo"
  1153. blockPlaced.Anchored = false
  1154. blockPlaced.CanCollide = false
  1155. local detector = Instance.new("Part", workspace:WaitForChild("Camera"))
  1156. detector.Transparency = 1
  1157. detector.CanCollide = false
  1158. detector.Size = Vector3.new(1, 0, 1)
  1159. local weldDetector = Instance.new("Motor6D", detector)
  1160. weldDetector.Part0 = detector
  1161. weldDetector.Part1 = blockPlaced
  1162. weldDetector.C1 = CFrame.new(0, -blockPlaced.Size.Y/2, 0)
  1163. local landed = false
  1164. local function fallingBlock()
  1165. coroutine.resume(coroutine.create(function()
  1166. local falling = Instance.new("CFrameValue", blockPlaced)
  1167. falling.Name = "IsFalling"
  1168. local grav = 0
  1169. while RS:wait() do
  1170. if landed then falling:Destroy() break end
  1171. grav = math.max(-1, grav - 0.0025)
  1172. blockPlaced.CFrame = CFrame.new(cFPos.X, blockPlaced.CFrame.Y + grav, cFPos.Z)
  1173. end
  1174. end))
  1175. end
  1176. fallingBlock()
  1177. detector.Touched:connect(function(part)
  1178. if blockPlaced.Anchored == false and part ~= blockPlaced and part.Name ~= "Debris" and part:FindFirstChild("IsFalling") == nil and findHumanoid(part) == nil then
  1179. landed = true
  1180. blockPlaced.CanCollide = true
  1181. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  1182. blockPlaced.Anchored = true
  1183. connectedTo.Value = part
  1184. local yOrigin = part.CFrame.Y + (blockPlaced.Size.Y/2) + (part.Size.Y/2)
  1185. blockPlaced.CFrame = CFrame.new(cFPos.X, yOrigin, cFPos.Z)
  1186. --detector:Destroy()
  1187. local falling = false
  1188. part.Changed:connect(function()
  1189. if part.Position.Y ~= yOrigin and falling == false then
  1190. falling = true
  1191. wait(0.075)
  1192. landed = false
  1193. blockPlaced.Anchored = false
  1194. blockPlaced.CanCollide = false
  1195. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  1196. fallingBlock()
  1197. falling = false
  1198. end
  1199. end)
  1200. workspace.ChildRemoved:connect(function()
  1201. --print("hi")
  1202. if connectedTo.Value.Parent == nil and falling == false then
  1203. falling = true
  1204. landed = false
  1205. blockPlaced.Anchored = false
  1206. blockPlaced.CanCollide = false
  1207. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  1208. fallingBlock()
  1209. end
  1210. end)
  1211. end
  1212. end)
  1213. end
  1214.  
  1215. local blockSound = Instance.new("Sound", blockPlaced)
  1216. blockSound.SoundId = block.sound
  1217. blockSound.Volume = block.soundVol
  1218. blockSound.Pitch = math.random(95, 105)/100
  1219. blockSound.PlayOnRemove = true
  1220. blockSound:Play()
  1221. return blockPlaced
  1222. end
  1223. end
  1224. if player then
  1225. local char = player.Character
  1226. if char then
  1227. for _,cM in pairs(char:GetChildren()) do
  1228. if cM.ClassName == "CharacterMesh" then cM:Destroy() end
  1229. end
  1230.  
  1231. --[]
  1232. local gui = player.PlayerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", player.PlayerGui)
  1233. gui.Name = "ToolBar"
  1234.  
  1235. makeSquare(UDim2.new(0.5, -166, 1, -111), UDim2.new(0, 364, 0, 44),
  1236. Color3.new(0/255, 0/255, 0/255), 0, gui)
  1237.  
  1238. for i = 1, 9 do
  1239. if toolBar[i] ~= nil then
  1240. local img = putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), toolBar[i].frontTex)
  1241. coroutine.resume(coroutine.create(function()
  1242. while wait() do
  1243. if toolBar[i] ~= nil then
  1244. img.Image = toolBar[i].frontTex
  1245. else
  1246. img.Image = ""
  1247. end
  1248. end
  1249. end))
  1250. else
  1251. local img = putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), "")
  1252. coroutine.resume(coroutine.create(function()
  1253. while wait() do
  1254. if toolBar[i] ~= nil then
  1255. img.Image = toolBar[i].frontTex
  1256. else
  1257. img.Image = ""
  1258. end
  1259. end
  1260. end))
  1261. end
  1262. end
  1263.  
  1264. local creativeInventoryGUI = makeInventory()
  1265.  
  1266. local humRootPart = char:WaitForChild("HumanoidRootPart")
  1267. local head = char:WaitForChild("Head")
  1268. local torso = char:WaitForChild("Torso")
  1269. local lArm = char:WaitForChild("Left Arm")
  1270. local rArm = char:WaitForChild("Right Arm")
  1271. local lLeg = char:WaitForChild("Left Leg")
  1272. local rLeg = char:WaitForChild("Right Leg")
  1273.  
  1274. local humanoid = char:WaitForChild("Humanoid")
  1275. char.Humanoid:ClearAllChildren()
  1276. humanoid.HipHeight = 0.3
  1277.  
  1278. humanoid.Parent = nil
  1279.  
  1280. if char:FindFirstChild("Animate") then
  1281. char.Animate:Remove()
  1282. end
  1283.  
  1284. head.Size = Vector3.new(1.3, 1.3, 1.3)
  1285. putTexture(head, "rbxassetid://38738031", "rbxassetid://36047330",
  1286. "rbxassetid://36047341", "rbxassetid://36047347",
  1287. "rbxassetid://36047323", "rbxassetid://36047315", "Decal")
  1288. head:WaitForChild("Mesh"):Destroy()
  1289. head:WaitForChild("face"):Destroy()
  1290.  
  1291. torso.Size = Vector3.new(1.3, 1.95, 0.65)
  1292. putTexture(torso, "rbxassetid://38934753", "rbxassetid://38934731",
  1293. "rbxassetid://38934780", "rbxassetid://38934740",
  1294. "rbxassetid://38934762", "rbxassetid://38934762", "Decal")
  1295.  
  1296. lArm.Size = Vector3.new(0.65, 1.95, 0.65)
  1297. putTexture(lArm, "rbxassetid://38934581", "rbxassetid://38934560",
  1298. "rbxassetid://38934613", "rbxassetid://38934568",
  1299. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  1300.  
  1301. rArm.Size = Vector3.new(0.65, 1.95, 0.65)
  1302. putTexture(rArm, "rbxassetid://38934560", "rbxassetid://38934581",
  1303. "rbxassetid://38934613", "rbxassetid://38934568",
  1304. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  1305.  
  1306. lLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  1307. putTexture(lLeg, "rbxassetid://38936226", "rbxassetid://38936209",
  1308. "rbxassetid://38934719", "rbxassetid://38934712",
  1309. "rbxassetid://38936255", "rbxassetid://38936242", "Decal")
  1310.  
  1311. rLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  1312. putTexture(rLeg, "rbxassetid://38936209", "rbxassetid://38936226",
  1313. "rbxassetid://38934719", "rbxassetid://38934712",
  1314. "rbxassetid://38936242", "rbxassetid://38936255", "Decal")
  1315.  
  1316. -- now for the real stuff
  1317. -- |
  1318. -- |
  1319. -- V
  1320. Instance.new("BlockMesh", torso)
  1321. Instance.new("BlockMesh", lArm)
  1322. Instance.new("BlockMesh", rArm)
  1323. Instance.new("BlockMesh", lLeg)
  1324. Instance.new("BlockMesh", rLeg)
  1325.  
  1326. local camera = workspace.Camera
  1327.  
  1328. local camPart = Instance.new("Part", camera)
  1329. camPart.Size = Vector3.new(0, 0, 0)
  1330. camPart.CFrame = camera.CFrame
  1331. camPart.CanCollide = false
  1332. camPart.Anchored = true
  1333. camPart.Transparency = 1
  1334.  
  1335. local cameraHand = Instance.new("Part", camera)
  1336. cameraHand.Size = Vector3.new(0.65, 1.95, 0.65)
  1337. cameraHand.CanCollide = false
  1338. cameraHand.Anchored = true
  1339. cameraHand.Name = "CameraHand"
  1340. putTexture(cameraHand, "rbxassetid://1405323558", "rbxassetid://38934581",
  1341. "rbxassetid://38934613", "rbxassetid://38934568",
  1342. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  1343.  
  1344. local cameraHandItem = Instance.new("Part", camera)
  1345. cameraHandItem.Name = "CameraHandItem"
  1346. cameraHandItem.Size = Vector3.new(1.1, 1.1, 1.1)
  1347. cameraHandItem.Anchored = true
  1348. cameraHandItem.CanCollide = false
  1349. cameraHandItem.Transparency = 1
  1350.  
  1351. -- welding doesn't really work.
  1352. --local cameraHandWeld = Instance.new("Motor6D", camPart)
  1353. --cameraHandWeld.Part0 = camPart
  1354. --cameraHandWeld.Part1 = cameraHand
  1355. --cameraHandWeld.C0 = CFrame.new(5, 0, 0)
  1356.  
  1357. local rootJoint = torso:FindFirstChild("RootJoint") or Instance.new("Motor6D", torso)
  1358. rootJoint.Name = "RootJoint"
  1359. rootJoint.Part0 = humRootPart
  1360. rootJoint.Part1 = torso
  1361. rootJoint.C1 = CFrame.new(0, 0.05, 0)
  1362.  
  1363. local neck = torso:FindFirstChild("Neck") or Instance.new("Motor6D", torso)
  1364. neck.Name = "Neck"
  1365. neck.Part0 = head
  1366. neck.Part1 = torso
  1367.  
  1368. local lS = torso:FindFirstChild("Left Shoulder") or Instance.new("Motor6D", torso)
  1369. lS.Name = "Left Shoulder"
  1370. lS.Part0 = lArm
  1371. lS.Part1 = torso
  1372. lS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1373. lS.C1 = CFrame.new(0.65, 0.975, 0)
  1374.  
  1375. local rS = torso:FindFirstChild("Right Shoulder") or Instance.new("Motor6D", torso)
  1376. rS.Name = "Right Shoulder"
  1377. rS.Part0 = rArm
  1378. rS.Part1 = torso
  1379. rS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1380. rS.C1 = CFrame.new(-0.65, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  1381.  
  1382. local lH = torso:FindFirstChild("Left Hip") or Instance.new("Motor6D", torso)
  1383. lH.Name = "Left Hip"
  1384. lH.Part0 = lLeg
  1385. lH.Part1 = torso
  1386. lH.C0 = CFrame.new(0, 0.975, 0)
  1387. lH.C1 = CFrame.new(0.325, -0.975, 0) * CFrame.Angles(0, 0, 0)
  1388.  
  1389. local rH = torso:FindFirstChild("Right Hip") or Instance.new("Motor6D", torso)
  1390. rH.Name = "Right Hip"
  1391. rH.Part0 = rLeg
  1392. rH.Part1 = torso
  1393. rH.C0 = CFrame.new(0, 0.975, 0)
  1394. rH.C1 = CFrame.new(-0.325, -0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  1395.  
  1396. for _,p in pairs(char:GetChildren()) do
  1397. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  1398. local hit = Instance.new("Part", char)
  1399. hit.Name = "DamagePart"
  1400. hit.BrickColor = BrickColor.new("Bright red")
  1401. hit.Material = "SmoothPlastic"
  1402. hit.Transparency = 1
  1403. hit.Size = Vector3.new(p.Size.X + 0.05, p.Size.Y + 0.05, p.Size.Z + 0.05)
  1404. hit.CanCollide = false
  1405. weldTo(hit, p)
  1406. end
  1407. end
  1408.  
  1409. wait(0.25)
  1410.  
  1411. -- local billNameTag = Instance.new("BillboardGui", char)
  1412. -- billNameTag.Size = UDim2.new(1, 0, 1, 0)
  1413. -- billNameTag.Adornee = head
  1414. -- billNameTag.PlayerToHideFrom = player
  1415. --
  1416. -- local textLabel = Instance.new("TextLabel", billNameTag)
  1417. -- textLabel.Font = "Arcade"
  1418. -- --textLabel.Size = UDim2.new(1, 0, 1, 0)
  1419. -- textLabel.TextScaled = true
  1420. -- --textLabel.TextSize = 100
  1421. -- textLabel.Text = targetName
  1422. -- textLabel.Size = UDim2.new(textLabel.TextBounds.X/100, 0, 0.75, 0)
  1423. -- textLabel.BorderSizePixel = 0
  1424. -- textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  1425. -- textLabel.TextColor3 = Color3.new(1, 1, 1)
  1426. -- textLabel.BackgroundTransparency = 0.5
  1427. --
  1428. -- if textLabel.Text == "Depr1" then -- why not?
  1429. -- textLabel.TextColor3 = Color3.new(1, 0.75, 0)
  1430. -- end
  1431. --
  1432. -- billNameTag.SizeOffset = Vector2.new(-textLabel.TextBounds.X/200 + 0.5, 0)
  1433. -- billNameTag.StudsOffset = Vector3.new(0, 1.5, 0)
  1434. --
  1435. -- humanoid.DisplayDistanceType = "None"
  1436. -- humanoid.NameDisplayDistance = 0
  1437.  
  1438. humanoid.Parent = char
  1439.  
  1440. local ticks = 0
  1441. local times = 0
  1442.  
  1443. local walkAnim = 0
  1444. local increaseWalkAnim = 1
  1445.  
  1446. local idleAnimRotX = 0
  1447. local idleAnimRotZ = 0
  1448. local sneaking = 0
  1449.  
  1450. --local RS = game:GetService("RunService").RenderStepped
  1451. local Mouse = player:GetMouse()
  1452.  
  1453. local oldHP = humanoid.Health
  1454. local damageTime = 0
  1455.  
  1456. local punchRotX = 0
  1457. local punchRotY = 0
  1458. local punchRotZ = 0
  1459. local punchRotXcam = 0
  1460. local punchRotYcam = 0
  1461. local punchRotZcam = 0
  1462. local punchSpeed = 0
  1463. local punching = 0
  1464. local selectedBlock = 8
  1465. local punchEnded = 1
  1466. local itemOnHand = nil
  1467.  
  1468. local selectBox = Instance.new("SelectionBox", camera)
  1469. selectBox.Transparency = 0.5
  1470. selectBox.Color3 = Color3.new(0, 0, 0)
  1471. selectBox.LineThickness = 0
  1472.  
  1473. local handItem = Instance.new("Part", char)
  1474. handItem.Name = "HandItem"
  1475. handItem.Size = Vector3.new(0.52, 0.52, 0.52)
  1476. handItem.Transparency = 1
  1477. handItem.CanCollide = false
  1478.  
  1479. local handItemWeld = Instance.new("Weld", char)
  1480. handItemWeld.Part0 = handItem
  1481. handItemWeld.Part1 = lArm
  1482. handItemWeld.C1 = CFrame.new(0, -0.9, -0.6) * CFrame.Angles(math.rad(-10), math.rad(45), 0)
  1483.  
  1484. local sound = Instance.new("Sound", char)
  1485. sound.Name = "Hurt"
  1486. sound.Volume = 10
  1487. sound.SoundId = "rbxassetid://535690488"
  1488.  
  1489. local facesToResize = {"Front", "Back", "Left", "Right", "Bottom", "Top"}
  1490.  
  1491. local camCurrentZoom = (camera.CFrame.p - head.Position).magnitude
  1492. Mouse.Button1Down:connect(function()
  1493. if punchEnded == 1 then punching = 1 end
  1494. if Mouse.Target then
  1495. if getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  1496. local humanoid = Mouse.Target.Parent:FindFirstChild("Humanoid")
  1497. if humanoid then
  1498. humanoid.Health = humanoid.Health - 10
  1499. local parts = Mouse.Target.Parent:GetChildren()
  1500. for _,p in pairs(parts) do
  1501. if p.ClassName == "Part" then
  1502. 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))
  1503. end
  1504. end
  1505. return
  1506. end
  1507. local x = Mouse.Target.CFrame.p.X
  1508. local y = Mouse.Target.CFrame.p.Y
  1509. local z = Mouse.Target.CFrame.p.Z
  1510. if Mouse.TargetSurface.Name == "Right" then x = x + 2.6 end
  1511. if Mouse.TargetSurface.Name == "Left" then x = x - 2.6 end
  1512. if Mouse.TargetSurface.Name == "Top" then y = y + 2.6 end
  1513. if Mouse.TargetSurface.Name == "Bottom" then y = y - 2.6 end
  1514. if Mouse.TargetSurface.Name == "Back" then z = z + 2.6 end
  1515. if Mouse.TargetSurface.Name == "Front" then z = z - 2.6 end
  1516. if Mouse.Target.Size.X > 2.6 or Mouse.Target.Size.Y > 2.6 or Mouse.Target.Size.Z > 2.6 then
  1517. x = Mouse.Hit.p.X
  1518. y = Mouse.Hit.p.Y
  1519. z = Mouse.Hit.p.Z
  1520. end
  1521. -- local x = round(math.abs(mouseX)/2.6)*2.6
  1522. -- local y = round(math.abs(mouseY)/2.6)*2.6
  1523. -- local z = round(math.abs(mouseZ)/2.6)*2.6
  1524. -- if Mouse.Hit.p.X < 0 then x = x * -1 end
  1525. -- if Mouse.Hit.p.Y < 0 then y = y * -1 end
  1526. -- if Mouse.Hit.p.Z < 0 then z = z * -1 end
  1527. local blk = placeBlock(toolBar[selectedBlock + 1], CFrame.new(x, y, z), Mouse)
  1528. if blk then
  1529. for _,f in pairs(facesToResize) do
  1530. blk:WaitForChild(f).StudsPerTileU = 2.6
  1531. blk:WaitForChild(f).StudsPerTileV = 2.6
  1532. end
  1533. end
  1534. end
  1535. end
  1536. end)
  1537.  
  1538. local changedItem = false
  1539. local hasItemOnHand = 0
  1540. local hi = 0
  1541. -- selection thingy
  1542. local selectLabel = Instance.new("TextLabel", gui)
  1543. selectLabel.Size = UDim2.new(0, 32, 0, 32)
  1544. selectLabel.Position = UDim2.new(0.5, -160 + (selectedBlock*40), 1, -105)
  1545. selectLabel.BackgroundTransparency = 0.5
  1546. selectLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  1547. selectLabel.BorderSizePixel = 0
  1548. selectLabel.Text = ""
  1549. selectLabel.ZIndex = 3
  1550. --
  1551. local oldItemOnHand = itemOnHand
  1552. function updateItemOnHand()
  1553. for _,d in pairs(handItem:GetChildren()) do
  1554. d:Destroy()
  1555. end
  1556. for _,d in pairs(cameraHandItem:GetChildren()) do
  1557. d:Destroy()
  1558. end
  1559. if itemOnHand ~= nil then
  1560. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  1561. itemOnHand.topTex, itemOnHand.bottomTex,
  1562. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  1563.  
  1564. putTexture(cameraHandItem, itemOnHand.frontTex, itemOnHand.backTex,
  1565. itemOnHand.topTex, itemOnHand.bottomTex,
  1566. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  1567.  
  1568. for _,f in pairs(facesToResize) do
  1569. handItem:WaitForChild(f).StudsPerTileU = 0.52
  1570. handItem:WaitForChild(f).StudsPerTileV = 0.52
  1571. end
  1572.  
  1573. for _,f in pairs(facesToResize) do
  1574. cameraHandItem:WaitForChild(f).StudsPerTileU = 1.1
  1575. cameraHandItem:WaitForChild(f).StudsPerTileV = 1.1
  1576. end
  1577.  
  1578. cameraHand.Transparency = 1
  1579. for _,f in pairs(facesToResize) do
  1580. cameraHand:WaitForChild(f).Transparency = 1
  1581. cameraHand:WaitForChild(f).Transparency = 1
  1582. end
  1583. else
  1584. cameraHand.Transparency = 0
  1585. for _,f in pairs(facesToResize) do
  1586. cameraHand:WaitForChild(f).Transparency = 0
  1587. cameraHand:WaitForChild(f).Transparency = 0
  1588. end
  1589. end
  1590. if oldItemOnHand ~= itemOnHand then
  1591. changedItem = true
  1592. end
  1593. end
  1594.  
  1595. local pressedWTimes = 0
  1596. local sprintingNum = 0
  1597. local sprinting = false
  1598. Mouse.KeyDown:connect(function(key)
  1599. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  1600. if (key == "w" and sprinting == false and sneaking == 0) then
  1601. if pressedWTimes >= 1 or key == Enum.KeyCode.LeftControl then
  1602. sprinting = true
  1603. humanoid.WalkSpeed = humanoid.WalkSpeed * 1.5
  1604. pressedWTimes = 0
  1605. coroutine.resume(coroutine.create(function()
  1606. for i = 1, 24 do
  1607. camera.FieldOfView = camera.FieldOfView + ((24-i)/10)
  1608. RS:wait()
  1609. end
  1610. end))
  1611. end
  1612. pressedWTimes = pressedWTimes + 1
  1613. coroutine.resume(coroutine.create(function()
  1614. for i = 1, 9 do
  1615. if sprinting == true then break end
  1616. wait()
  1617. end
  1618. pressedWTimes = 0
  1619. end))
  1620. end
  1621. if key == "q" and sprinting == false then
  1622. sneaking = 1
  1623. humanoid.WalkSpeed = humanoid.WalkSpeed / 2
  1624. humanoid.HipHeight = humanoid.HipHeight - 0.35
  1625. rootJoint.C1 = CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  1626. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  1627. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  1628. --print("Sneaking...")
  1629. end
  1630. if key == "e" then
  1631. if creativeInventoryGUI.Visible == true then
  1632. creativeInventoryGUI.Visible = false
  1633. elseif creativeInventoryGUI.Visible == false then
  1634. creativeInventoryGUI.Visible = true
  1635. end
  1636. end
  1637. if key == "1" or key == "2" or key == "3" or
  1638. key == "4" or key == "5" or key == "6" or
  1639. key == "7" or key == "8" or key == "9" then
  1640. selectedBlock = tonumber(key) - 1
  1641. oldItemOnHand = itemOnHand
  1642. itemOnHand = toolBar[tonumber(key)]
  1643. updateItemOnHand()
  1644. if hasItemOnHand == 0 and itemOnHand then hi = 1 end
  1645. if hasItemOnHand == 1 and itemOnHand == nil then hi = 1 end
  1646. end
  1647. --if (key == "0" or key == "1" or key == "2"
  1648. -- or key == "3" or key == "4" or key == "5"
  1649. -- or key == "6" or key == "7") and hasItemOnHand == 0 then hi = 1 end
  1650. selectLabel.Position = UDim2.new(0.5, -160 + ((selectedBlock)*40), 1, -105)
  1651. end)
  1652.  
  1653. Mouse.KeyUp:connect(function(key)
  1654. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  1655. if (key == "w" and sprinting == true and sneaking == 0) then
  1656. sprinting = false
  1657. humanoid.WalkSpeed = humanoid.WalkSpeed / 1.5
  1658. coroutine.resume(coroutine.create(function()
  1659. for i = 1, 24 do
  1660. camera.FieldOfView = camera.FieldOfView - ((24-i)/10)
  1661. RS:wait()
  1662. end
  1663. end))
  1664. end
  1665. if key == "q" and sprinting == false then
  1666. sneaking = 0
  1667. humanoid.WalkSpeed = humanoid.WalkSpeed * 2
  1668. humanoid.HipHeight = humanoid.HipHeight + 0.35
  1669. rootJoint.C1 = CFrame.new(0, 0.05, 0) * CFrame.Angles(0, 0, 0)
  1670. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1671. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1672. --print("Stopped sneaking...")
  1673. end
  1674. end)
  1675.  
  1676. Mouse.TargetFilter = camera
  1677.  
  1678. local humOffset = CFrame.new(0, 0, 0)
  1679. local camHandY = 0
  1680. local cameraHandCFrame = CFrame.new(1.15, -1.35, -2) * CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(55), math.rad(20))
  1681. while RS:wait() do
  1682. camCurrentZoom = ((CFrame.new(0, -1*sneaking, 0) * camera.CFrame).p - head.Position).magnitude
  1683. if itemOnHand ~= nil then
  1684. hasItemOnHand = 1
  1685. handItem.Transparency = itemOnHand.transparency
  1686. else
  1687. hasItemOnHand = 0
  1688. handItem.Transparency = 1
  1689. end
  1690. if humanoid.Health < oldHP then
  1691. damageTime = 60
  1692. sound:Play()
  1693. end
  1694. oldHP = humanoid.Health
  1695. if damageTime > 0 and humanoid.Health > 0 then
  1696. for _,p in pairs(char:GetChildren()) do
  1697. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  1698. if p.Name == "DamagePart" then
  1699. p.Transparency = 0.5
  1700. end
  1701. end
  1702. end
  1703. damageTime = damageTime - 2
  1704. if damageTime <= 0 then
  1705. for _,p in pairs(char:GetChildren()) do
  1706. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  1707. if p.Name == "DamagePart" then
  1708. p.Transparency = 1
  1709. end
  1710. end
  1711. end
  1712. end
  1713. end
  1714. camPart.CFrame = camera.CFrame
  1715. neck.C1 = CFrame.new(0, 0.975, 0) * CFrame.fromEulerAnglesXYZ(math.rad(sneaking*45), math.rad(camPart.Orientation.Y - torso.Orientation.Y), 0)
  1716. neck.C0 = CFrame.new(0, -0.65, 0) * CFrame.Angles(-math.rad(camPart.Orientation.X - torso.Orientation.X - (sneaking*45)), 0, 0)
  1717.  
  1718. if getMagnitudeXZ(torso.Velocity) > 1 then
  1719. if walkAnim >= 1 then
  1720. increaseWalkAnim = -1
  1721. elseif walkAnim <= -1 then
  1722. increaseWalkAnim = 1
  1723. end
  1724. walkAnim = walkAnim + (increaseWalkAnim/(10+(sneaking*20)))
  1725. else
  1726. walkAnim = 0
  1727. end
  1728.  
  1729. --lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  1730. --rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  1731. lH.C0 = lH.C0:lerp(CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)), 0, 0), 0.1)
  1732. rH.C0 = rH.C0:lerp(CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)), 0, 0), 0.1)
  1733. --
  1734. --rootJoint.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  1735. --print(math.abs(head.Orientation.Y) - math.abs(humRootPart.Orientation.Y))
  1736. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) > 45 then
  1737. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(-45 + head.Orientation.Y), 0)
  1738. --print("-45")
  1739. --end
  1740. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) < -45 then
  1741. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(45 + head.Orientation.Y), 0)
  1742. --print("45")
  1743. --end
  1744.  
  1745. if changedItem then
  1746. changedItem = false
  1747. coroutine.resume(coroutine.create(function()
  1748. for i = 1, 8 do
  1749. camHandY = camHandY - 0.2
  1750. RS:wait()
  1751. end
  1752. for i = 1, 8 do
  1753. camHandY = camHandY + 0.2
  1754. RS:wait()
  1755. end
  1756. end))
  1757. end
  1758.  
  1759. --move these arms
  1760. rootJoint.C1 = rootJoint.C1:lerp(CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*45), math.rad(punchRotY), 0), 0.2)
  1761.  
  1762. lS.C0 = lS.C0:lerp(CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(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) + divide(punchSpeed, 6) + hi)
  1763. rS.C0 = rS.C0:lerp(CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(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))
  1764.  
  1765. if Mouse.Target and getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  1766. if Mouse.Target.Parent:FindFirstChild("Humanoid") == nil and Mouse.Target.Parent ~= camera then
  1767. selectBox.Adornee = Mouse.Target
  1768. else
  1769. selectBox.Adornee = nil
  1770. end
  1771. else
  1772. selectBox.Adornee = nil
  1773. end
  1774.  
  1775. local BobbingY = walkAnim*2
  1776. if BobbingY >= 1 then BobbingY = -BobbingY + 0.5 end
  1777.  
  1778. cameraHandCFrame = cameraHandCFrame:lerp(CFrame.new(1.15*1.3 + (walkAnim/2 - (walkAnim/3)), -1.35*1.3 + camHandY + (-BobbingY/8), -0.45 + ((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)
  1779.  
  1780. humOffset = humOffset:lerp(CFrame.new(walkAnim/4 - (walkAnim/8), BobbingY/13, 0), 0.25)
  1781. humanoid.CameraOffset = Vector3.new(humOffset.X, humOffset.Y, 0)
  1782.  
  1783. cameraHand.CFrame = camPart.CFrame * cameraHandCFrame
  1784.  
  1785. 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)
  1786.  
  1787. if camCurrentZoom >= 1.5 then
  1788. cameraHand.Transparency = 1
  1789. for _,t in pairs(cameraHand:GetChildren()) do
  1790. if t.Transparency == 0 then
  1791. t.Transparency = 1
  1792. end
  1793. end
  1794. for _,t in pairs(cameraHandItem:GetChildren()) do
  1795. if t.Transparency == 0 then
  1796. t.Transparency = 1
  1797. end
  1798. end
  1799. else
  1800. cameraHand.Transparency = hasItemOnHand
  1801. for _,t in pairs(cameraHand:GetChildren()) do
  1802. if t.Transparency == 1 then
  1803. t.Transparency = hasItemOnHand
  1804. end
  1805. end
  1806. for _,t in pairs(cameraHandItem:GetChildren()) do
  1807. if t.Transparency == 1 then
  1808. t.Transparency = 0
  1809. end
  1810. end
  1811. end
  1812.  
  1813. if updateHand == true then
  1814. updateHand = false
  1815. updateItemOnHand()
  1816. end
  1817.  
  1818. if punching == 1 and punchEnded == 1 then
  1819. punching = 0
  1820. --print("steve uses punch!!")
  1821. local coPunchCam = coroutine.wrap(function()
  1822. local mult = 2
  1823. punchRotXcam = 40/2*mult
  1824. punchRotYcam = 25/2*mult
  1825. wait(0.075/2)
  1826. punchRotXcam = 50/2*mult
  1827. punchRotYcam = 25*mult
  1828. punchRotZcam = -10*mult
  1829. wait(0.075/2)
  1830. punchRotYcam = 50/1.5*mult
  1831. punchRotXcam = -10*mult
  1832. --wait(0.075/2)
  1833. --punchRotYcam = 50
  1834. --punchRotXcam = -10
  1835. wait(0.02)
  1836. punchRotXcam = -20*mult
  1837. wait(0.055)
  1838. punchRotXcam = 0
  1839. punchRotYcam = 0
  1840. punchRotZcam = 0
  1841. end)
  1842. local coPunch = coroutine.wrap(function()
  1843. punchEnded = 0
  1844. punchSpeed = 1
  1845. punchRotX = -60
  1846. punchRotY = -8
  1847. punchRotZ = -35
  1848.  
  1849. wait(0.075/1.3)
  1850. punchSpeed = 1
  1851. punchRotX = -75
  1852. punchRotY = 8
  1853. punchRotZ = 40
  1854. wait(0.075/1.3)
  1855. punchSpeed = 1
  1856. punchRotX = -20
  1857. punchRotZ = 40
  1858. wait(0.075/1.3)
  1859. punchSpeed = 3.5
  1860. punchRotX = 0
  1861. punchRotY = 0
  1862. punchRotZ = 0
  1863.  
  1864. punchRotXcam = 0
  1865. punchRotYcam = 0
  1866. punchRotZcam = 0
  1867.  
  1868. punchEnded = 1
  1869. wait(0.06/1.3)
  1870. punchSpeed = 0
  1871. end)
  1872. coPunch()
  1873. coPunchCam()
  1874. end
  1875. if ticks > 20 then
  1876. ticks = 0
  1877. if times == 0 then
  1878. times = times + 1
  1879. idleAnimRotX = -1
  1880. idleAnimRotZ = 0
  1881. elseif times == 1 then
  1882. times = times + 1
  1883. idleAnimRotX = -0.75
  1884. idleAnimRotZ = -0.75
  1885. elseif times == 2 then
  1886. times = times + 1
  1887. idleAnimRotX = 0
  1888. idleAnimRotZ = -1
  1889. elseif times == 3 then
  1890. times = times + 1
  1891. idleAnimRotX = 0.75
  1892. idleAnimRotZ = -0.75
  1893. --idleAnimRotX = 0.75
  1894. --idleAnimRotZ = -0
  1895. elseif times == 4 then
  1896. times = times + 1
  1897. idleAnimRotX = 1
  1898. idleAnimRotZ = 0
  1899. --idleAnimRotX = 1
  1900. --idleAnimRotZ = 0
  1901. elseif times == 5 then
  1902. times = times + 1
  1903. idleAnimRotX = 0.75
  1904. idleAnimRotZ = 0.75
  1905. elseif times == 6 then
  1906. times = times + 1
  1907. idleAnimRotX = 0
  1908. idleAnimRotZ = 1
  1909. elseif times == 7 then
  1910. times = 0
  1911. idleAnimRotX = -0.75
  1912. idleAnimRotZ = 0.75
  1913. end
  1914. end
  1915. if hi == 1 then hi = 0 end
  1916. ticks = ticks + 1
  1917. end
  1918. end
  1919. end
Add Comment
Please, Sign In to add comment