Advertisement
Mediakiller7Cool

adad

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