Advertisement
Guest User

void script builder ui pre alpha

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