DrawingJhon

Steve

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