Advertisement
HenloMyDude

test (run as local)

Sep 2nd, 2019
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 164.88 KB | None | 0 0
  1.  
  2.  
  3. --Converted with ttyyuu12345's model to script plugin v4
  4. function sandbox(var,func)
  5. local env = getfenv(func)
  6. local newenv = setmetatable({},{
  7. __index = function(self,k)
  8. if k=="script" then
  9. return var
  10. else
  11. return env[k]
  12. end
  13. end,
  14. })
  15. setfenv(func,newenv)
  16. return func
  17. end
  18. cors = {}
  19. mas = Instance.new("Model",game:GetService("Lighting"))
  20. ModuleScript0 = Instance.new("ModuleScript")
  21. ModuleScript1 = Instance.new("ModuleScript")
  22. ModuleScript0.Name = "MouseModule"
  23. ModuleScript0.Parent = mas
  24. table.insert(cors,sandbox(ModuleScript0,function()
  25. -- Mouse
  26. -- Crazyman32
  27. -- April 28, 2015
  28. --[[
  29. Usage:
  30. local mouse = require(thisModule).new()
  31. METHODS:
  32. <Vector2 position, Vector2 delta> mouse:GetPosition()
  33. <Boolean isDown> mouse:IsDown(UserInputType button)
  34. <CFrame cframe, Object target, Vector3 normal> mouse:ProjectMouseRay(table ignoreList)
  35. EVENTS:
  36. mouse.ButtonDown(UserInputType button)
  37. mouse.ButtonUp(UserInputType button)
  38. mouse.Moved(Vector2 position, Vector2 deltaPosition)
  39. mouse.Scrolled(Integer delta)
  40. --]]
  41. local Mouse = {}
  42. Mouse.__index = Mouse
  43. function Mouse.new()
  44. local player = game.Players.LocalPlayer
  45. assert(player, "Could not get player")
  46. local cam = game.Workspace.CurrentCamera
  47. local Ray = Ray.new
  48. local input = game:GetService("UserInputService")
  49. local button1 = Enum.UserInputType.MouseButton1
  50. local button2 = Enum.UserInputType.MouseButton2
  51. local button3 = Enum.UserInputType.MouseButton3
  52. local mouseMovement = Enum.UserInputType.MouseMovement
  53. local mouseWheel = Enum.UserInputType.MouseWheel
  54. local mouse = {}
  55. local mousePos, mouseDelta = Vector2.new(workspace.CurrentCamera.ViewportSize.X/2,workspace.CurrentCamera.ViewportSize.Y/2 - 36), Vector2.new()
  56. local clicking = {
  57. [button1] = false;
  58. [button2] = false;
  59. [button3] = false;
  60. }
  61. local function CreateEvent(eventName)
  62. local e = Instance.new("BindableEvent")
  63. mouse[eventName] = e.Event
  64. return function(...)
  65. e:Fire(...)
  66. end
  67. end
  68. -- Events ---------------------------------------------------------------
  69. local buttonDown = CreateEvent("ButtonDown")
  70. local buttonUp = CreateEvent("ButtonUp")
  71. local moved = CreateEvent("Moved")
  72. local scrolled = CreateEvent("Scrolled")
  73. -------------------------------------------------------------------------
  74. -- API ------------------------------------------------------------------
  75. function mouse:IsDown(inputType)
  76. return (clicking[inputType] == true)
  77. end
  78. function mouse:GetPosition()
  79. return mousePos, mouseDelta
  80. end
  81. function mouse:ProjectMouseRay(ignoreList)
  82. ignoreList = ignoreList or {}
  83. local pos = self:GetPosition()
  84. local ray = cam:ScreenPointToRay(pos.X, pos.Y, 0)
  85. ray = Ray(ray.Origin, (ray.Unit.Direction * 999))
  86. local hit, hitPos, normal = game.Workspace:FindPartOnRayWithIgnoreList(ray, ignoreList or {}, true, false)
  87. local cframe = CFrame.new(hitPos, (hitPos + ray.Unit.Direction))
  88. if (hit) and (hit.Transparency >= 1) then
  89. table.insert(ignoreList,hit)
  90. return mouse:ProjectMouseRay(ignoreList)
  91. elseif (hit) and (not hit.CanCollide) then
  92. table.insert(ignoreList,hit)
  93. return mouse:ProjectMouseRay(ignoreList)
  94. elseif (hit) and (hit:FindFirstAncestorOfClass("Tool")) then
  95. table.insert(ignoreList,hit)
  96. return mouse:ProjectMouseRay(ignoreList)
  97. else
  98. return cframe, hit, normal
  99. end
  100. end
  101. function mouse:ProjectMouseRay2(whiteList)
  102. local pos = self:GetPosition()
  103. local ray = cam:ScreenPointToRay(pos.X, pos.Y, 0)
  104. ray = Ray(ray.Origin, (ray.Unit.Direction * 999))
  105. local hit, hitPos, normal = game.Workspace:FindPartOnRayWithWhitelist(ray, whiteList or {}, true, false)
  106. local cframe = CFrame.new(hitPos, (hitPos + ray.Unit.Direction))
  107. return cframe, hit, normal
  108. end
  109. -------------------------------------------------------------------------
  110. -- UserInputService Setup -----------------------------------------------
  111. local function InputBegan(inputObject, gameProcessed)
  112. if (gameProcessed) then return end
  113. local inputType = inputObject.UserInputType
  114. if (inputType == button1 or inputType == button2 or inputType == button3) then
  115. clicking[inputType] = true
  116. buttonDown(inputType)
  117. end
  118. end
  119. local function InputChanged(inputObject, gameProcessed)
  120. --if (gameProcessed) then return end
  121. local inputType = inputObject.UserInputType
  122. if (inputType == mouseMovement) then
  123. local newMousePos = Vector2.new(inputObject.Position.X, inputObject.Position.Y)
  124. local delta = newMousePos - mousePos
  125. mousePos = newMousePos
  126. mouseDelta = Vector2.new(delta.X, delta.Y)
  127. moved(mousePos, mouseDelta)
  128. elseif (inputType == mouseWheel) then
  129. local num = inputObject.Position.Z
  130. scrolled(num < 0 and -1 or num > 0 and 1 or 0)
  131. end
  132. end
  133. local function InputEnded(inputObject, gameProcessed)
  134. --if (gameProcessed) then return end
  135. local inputType = inputObject.UserInputType
  136. if (inputType == button1 or inputType == button2 or inputType == button3) then
  137. clicking[inputType] = false
  138. buttonUp(inputType)
  139. end
  140. end
  141. input.InputBegan:connect(InputBegan)
  142. input.InputChanged:connect(InputChanged)
  143. input.InputEnded:connect(InputEnded)
  144. -------------------------------------------------------------------------
  145. return setmetatable(mouse, Mouse)
  146. end
  147. function Mouse:__tostring()
  148. local pos = self:GetPosition()
  149. return ("Mouse <" .. tostring(pos) .. ">")
  150. end
  151. return Mouse
  152.  
  153. end))
  154. ModuleScript1.Name = "FontModule"
  155. ModuleScript1.Parent = mas
  156. table.insert(cors,sandbox(ModuleScript1,function()
  157. local ft = {}
  158.  
  159. local scale = 2
  160. local defaultfsp = 5
  161. local fontsizes = {
  162.  
  163. }
  164.  
  165. local ftex = script.Parent:WaitForChild("Font")
  166.  
  167. function ft.linkLabel(label)
  168. label.TextTransparency = 1
  169. label.TextStrokeTransparency = 1
  170. label:GetPropertyChangedSignal("Text"):Connect(function()
  171. label.TextTransparency = 1
  172. label.TextStrokeTransparency = 1
  173. label:ClearAllChildren()
  174.  
  175. local len = label.Text:len()
  176. if len > 0 then
  177. for i=1,len do
  178. local let = label.Text:sub(i,i)
  179. local cf = ftex:FindFirstChild(let)
  180. if cf then
  181. local cf = cf:Clone()
  182. cf.Size = UDim2.new(0,16,0,16)
  183. cf.Position = UDim2.new(1,-defaultfsp*2 - (defaultfsp*scale + scale) * (len - i),1,-16)
  184. for _,v in pairs(cf:GetChildren()) do
  185. if v:IsA("Frame") then
  186. v.BackgroundColor3 = label.TextColor3
  187. end
  188. end
  189. cf.Parent = label
  190. end
  191. end
  192. end
  193. end)
  194. end
  195.  
  196. return ft
  197.  
  198. end))
  199. for i,v in pairs(mas:GetChildren()) do
  200. v.Parent = script
  201. pcall(function() v:MakeJoints() end)
  202. end
  203. mas:Destroy()
  204. for i,v in pairs(cors) do
  205. spawn(function()
  206. pcall(v)
  207. end)
  208. end
  209.  
  210.  
  211. function sandbox(var,func)
  212. local env = getfenv(func)
  213. local newenv = setmetatable({},{
  214. __index = function(self,k)
  215. if k=="script" then
  216. return var
  217. else
  218. return env[k]
  219. end
  220. end,
  221. })
  222. setfenv(func,newenv)
  223. return func
  224. end
  225. cors = {}
  226. mas = Instance.new("Model",game:GetService("Lighting"))
  227. Folder0 = Instance.new("Folder")
  228. ModuleScript1 = Instance.new("ModuleScript")
  229. ModuleScript2 = Instance.new("ModuleScript")
  230. ModuleScript3 = Instance.new("ModuleScript")
  231. ModuleScript4 = Instance.new("ModuleScript")
  232. ModuleScript5 = Instance.new("ModuleScript")
  233. ModuleScript6 = Instance.new("ModuleScript")
  234. ModuleScript7 = Instance.new("ModuleScript")
  235. ModuleScript8 = Instance.new("ModuleScript")
  236. Folder9 = Instance.new("Folder")
  237. Sound10 = Instance.new("Sound")
  238. Sound11 = Instance.new("Sound")
  239. Sound12 = Instance.new("Sound")
  240. Sound13 = Instance.new("Sound")
  241. Sound14 = Instance.new("Sound")
  242. Sound15 = Instance.new("Sound")
  243. Sound16 = Instance.new("Sound")
  244. Sound17 = Instance.new("Sound")
  245. Sound18 = Instance.new("Sound")
  246. Sound19 = Instance.new("Sound")
  247. Sky20 = Instance.new("Sky")
  248. Folder21 = Instance.new("Folder")
  249. RemoteFunction22 = Instance.new("RemoteFunction")
  250. RemoteFunction23 = Instance.new("RemoteFunction")
  251. RemoteEvent24 = Instance.new("RemoteEvent")
  252. RemoteEvent25 = Instance.new("RemoteEvent")
  253. RemoteEvent26 = Instance.new("RemoteEvent")
  254. RemoteEvent27 = Instance.new("RemoteEvent")
  255. RemoteFunction28 = Instance.new("RemoteFunction")
  256. RemoteFunction29 = Instance.new("RemoteFunction")
  257. RemoteFunction30 = Instance.new("RemoteFunction")
  258. RemoteFunction31 = Instance.new("RemoteFunction")
  259. RemoteFunction32 = Instance.new("RemoteFunction")
  260. RemoteFunction33 = Instance.new("RemoteFunction")
  261. RemoteEvent34 = Instance.new("RemoteEvent")
  262. RemoteEvent35 = Instance.new("RemoteEvent")
  263. RemoteFunction36 = Instance.new("RemoteFunction")
  264. RemoteFunction37 = Instance.new("RemoteFunction")
  265. RemoteEvent38 = Instance.new("RemoteEvent")
  266. Folder39 = Instance.new("Folder")
  267. IntValue40 = Instance.new("IntValue")
  268. IntValue41 = Instance.new("IntValue")
  269. IntValue42 = Instance.new("IntValue")
  270. Folder43 = Instance.new("Folder")
  271. Folder44 = Instance.new("Folder")
  272. RemoteFunction45 = Instance.new("RemoteFunction")
  273. RemoteEvent46 = Instance.new("RemoteEvent")
  274. RemoteEvent47 = Instance.new("RemoteEvent")
  275. RemoteEvent48 = Instance.new("RemoteEvent")
  276. Vector3Value49 = Instance.new("Vector3Value")
  277. Folder0.Name = "AssetsMod"
  278. Folder0.Parent = mas
  279. ModuleScript1.Name = "Textures"
  280. ModuleScript1.Parent = Folder0
  281. table.insert(cors,sandbox(ModuleScript1,function()
  282. return {
  283.  
  284. -- Blocks
  285. ["grasstop"] = 3131912045, -- Full grassy; Top texture of a grass block
  286. ["grassside"] = 3132023393, -- Dirt at bottom, some grass at top; Texture of sides of a grass block
  287. ["dirt"] = 3103457697, -- Full dirt; Bottom texture of a grass block
  288.  
  289. ["stone"] = 3131912893, -- Full stone
  290. ["cobble"] = 3718806379,
  291.  
  292. ["sand"] = 3725400827,
  293.  
  294. ["bricks"] = 3479487392,
  295.  
  296. ["glass"] = 3149393569, -- Transparent, often surrounded by white lines
  297.  
  298.  
  299. ["logside"] = 3149643651, -- Side of a log -- Known textures: 3595677229, 71445924
  300. ["logcut"] = 3149644490, -- Top/bottom of logs, similar to log texture
  301. ["planks"] = 3131912507, -- Fully planks
  302.  
  303. ["leaves"] = 140507911, -- Fully leaves, semi-transparent
  304.  
  305.  
  306.  
  307. ["coalblock"] = 150433747, -- Fully coal (dark color)
  308. ["ironblock"] = 59406020, -- Fully iron (platinum like color)
  309. ["diamondblock"] = 140574423, -- Fully diamond (cyan like color)
  310.  
  311.  
  312. ["obsidian"] = 3725380400, -- Fully obsidian
  313.  
  314.  
  315. ["bedrock"] = 3725398839, -- Darker texture of stone
  316.  
  317.  
  318. ["crafttop"] = 3725388039,
  319. ["craftside"] = 3725405589,
  320. ["craftfront"] = 3725408235,
  321.  
  322. ["furnacetop"] = 3725389003, -- Top texture of the furnace, stone type
  323. ["furnaceside"] = 3725386392,
  324. ["furnace"] = 3725390238, -- Stone-type furnace, with 1 slot at bottom half and another one on top half with one output slot that shares space.
  325. ["litfurnace"] = 3725390238, -- Furnace with bottom half lit
  326.  
  327.  
  328. ["diamondore"] = 3479489943, -- Diamonds (cyan-like color) stuck in a stone
  329. ["ironore"] = 3479499952, -- Iron nuggets (platinum-like color) stuck in a stone
  330. ["coalore"] = 3479489080, -- Coal stuck in a stone
  331.  
  332. -- Non-solids
  333.  
  334.  
  335. -- Liquid
  336.  
  337. ["water"] = 204384984,
  338. ["water"] = 204384984,
  339. }
  340. end))
  341. ModuleScript2.Name = "Sounds"
  342. ModuleScript2.Parent = Folder0
  343. table.insert(cors,sandbox(ModuleScript2,function()
  344. return {
  345.  
  346. -- hurt
  347. ["hurt1"] = 3362337129,
  348. ["hurt2"] = 3362346832,
  349. ["hurt3"] = 3362346832,
  350.  
  351. }
  352. end))
  353. ModuleScript3.Name = "BlockInfo"
  354. ModuleScript3.Parent = Folder0
  355. table.insert(cors,sandbox(ModuleScript3,function()
  356. local defaultFP = {
  357. CFrame.new(0,0,0) * CFrame.Angles(0,-math.pi/2,0),
  358. CFrame.new(0,0,0) * CFrame.Angles(0,math.pi/2,0),
  359. CFrame.new(0,0,0) * CFrame.Angles(0,math.pi,0),
  360. CFrame.new(0,0,0) * CFrame.Angles(0,0,0)
  361. }
  362.  
  363. return {
  364. Dirt = {
  365. hardness = .5,
  366. drop = "Dirt",
  367. hasItsOwnItem = true,
  368.  
  369. material = "dirt",
  370.  
  371. texture = "dirt"
  372. },
  373. GrassBlock = {
  374. hardness = .6,
  375. drop = "Dirt",
  376. hasItsOwnItem = "Grass Block",
  377.  
  378. material = "grass",
  379.  
  380. texture = {
  381. [Enum.NormalId.Top] = "grasstop",
  382. [Enum.NormalId.Front] = "grassside",
  383. [Enum.NormalId.Left] = "grassside",
  384. [Enum.NormalId.Right] = "grassside",
  385. [Enum.NormalId.Back] = "grassside",
  386. [Enum.NormalId.Bottom] = "dirt",
  387. }
  388. },
  389.  
  390.  
  391. Sand = {
  392. hardness = .5,
  393. drop = "Sand",
  394. hasItsOwnItem = true,
  395.  
  396. material = "sand",
  397.  
  398. texture = "sand",
  399. },
  400.  
  401. Water = {
  402. hardness = 100,
  403. hasItsOwnItem = true,
  404.  
  405. blocktype = "fluid",
  406.  
  407. material = "water",
  408.  
  409. texture = "water",
  410. customBlock = true,
  411. },
  412. Lava = {
  413. hardness = 100,
  414. hasItsOwnItem = true,
  415.  
  416. blocktype = "fluid",
  417.  
  418. material = "lava",
  419.  
  420. texture = "lava",
  421. customBlock = true,
  422. },
  423.  
  424.  
  425. Bedrock = {
  426. hardness = 100000,
  427. hasItsOwnItem = true,
  428.  
  429. material = "stone",
  430.  
  431. texture = "bedrock"
  432. },
  433. Stone = {
  434. hardness = 1.5,
  435. drop = "Cobblestone",
  436. toolRequire = "pickaxe",
  437. hasItsOwnItem = true,
  438.  
  439. material = "stone",
  440.  
  441. texture = "stone"
  442. },
  443. Cobblestone = {
  444. hardness = 1.5,
  445. drop = "Cobblestone",
  446. toolRequire = "pickaxe",
  447. hasItsOwnItem = true,
  448.  
  449. material = "stone",
  450.  
  451. texture = "cobble"
  452. },
  453.  
  454.  
  455. Leaves = {
  456. hardness = .2,
  457. hasItsOwnItem = true,
  458.  
  459. raredrop = {
  460. {1/20,"Stick"}
  461. },
  462.  
  463. material = "leaves",
  464.  
  465. texture = "leaves",
  466. customBlock = true,
  467. },
  468.  
  469. OakLog = {
  470. hardness = 2,
  471. drop = "OakLog",
  472. hasItsOwnItem = "Log",
  473.  
  474. betterTool = "axe",
  475.  
  476. material = "wood",
  477.  
  478. texture = {
  479. [Enum.NormalId.Top] = "logcut",
  480. [Enum.NormalId.Front] = "logside",
  481. [Enum.NormalId.Left] = "logside",
  482. [Enum.NormalId.Right] = "logside",
  483. [Enum.NormalId.Back] = "logside",
  484. [Enum.NormalId.Bottom] = "logcut",
  485. }
  486. },
  487. OakPlanks = {
  488. hardness = 2,
  489. drop = "OakPlanks",
  490. hasItsOwnItem = "Planks",
  491.  
  492. betterTool = "axe",
  493.  
  494. material = "wood",
  495.  
  496. texture = "planks"
  497. },
  498.  
  499.  
  500. CraftingTable = {
  501. hardness = 2,
  502. drop = "CraftingTable",
  503. hasItsOwnItem = "Crafting Table",
  504.  
  505. betterTool = "axe",
  506.  
  507. material = "wood",
  508.  
  509. texture = {
  510. [Enum.NormalId.Top] = "crafttop",
  511. [Enum.NormalId.Front] = "craftfront",
  512. [Enum.NormalId.Left] = "craftside",
  513. [Enum.NormalId.Right] = "craftside",
  514. [Enum.NormalId.Back] = "craftfront",
  515. [Enum.NormalId.Bottom] = "planks",
  516. },
  517.  
  518. facingPos = defaultFP
  519. },
  520. Furnace = {
  521. hardness = 3.5,
  522. drop = "Furnace",
  523. hasItsOwnItem = "Furnace",
  524. toolRequire = "pickaxe",
  525.  
  526. material = "stone",
  527.  
  528. facingPos = defaultFP
  529. },
  530. Chest = {
  531. hardness = 2.5,
  532. drop = "Chest",
  533. hasItsOwnItem = true,
  534. betterTool = "axe",
  535.  
  536. material = "wood",
  537.  
  538. facingPos = defaultFP
  539. },
  540.  
  541.  
  542. Glass = {
  543. hardness = .3,
  544. hasItsOwnItem = true,
  545.  
  546. material = "glass",
  547.  
  548. texture = "glass",
  549. },
  550.  
  551. Bricks = {
  552. hardness = 2,
  553. drop = "Bricks",
  554. toolRequire = "pickaxe",
  555.  
  556. material = "stone",
  557.  
  558. texture = "bricks",
  559. },
  560.  
  561.  
  562. CoalOre = {
  563. hardness = 3,
  564. drop = "Coal",
  565. toolRequire = "pickaxe",
  566. toolLevelRequire = "wooden",
  567. hasItsOwnItem = "Coal Ore",
  568.  
  569. material = "stone",
  570.  
  571. texture = "coalore"
  572. },
  573. IronOre = {
  574. hardness = 3,
  575. drop = "IronIngot",--"IronOre",
  576. toolRequire = "pickaxe",
  577. toolLevelRequire = "stone",
  578. hasItsOwnItem = "Iron Ore",
  579.  
  580. material = "stone",
  581.  
  582. texture = "ironore"
  583. },
  584. DiamondOre = {
  585. hardness = 3,
  586. drop = "Diamond",
  587. toolRequire = "pickaxe",
  588. toolLevelRequire = "iron",
  589. hasItsOwnItem = "Diamond Ore",
  590.  
  591. material = "stone",
  592.  
  593. texture = "diamondore"
  594. },
  595.  
  596.  
  597. CoalBlock = {
  598. id = 173,
  599.  
  600. hardness = 5,
  601. drop = "CoalBlock",
  602. toolRequire = "pickaxe",
  603. hasItsOwnItem = true,
  604.  
  605. material = "stone",
  606.  
  607. texture = "coalblock"
  608. },
  609. IronBlock = {
  610. id = 42,
  611. hardness = 5,
  612. drop = "IronBlock",
  613. toolRequire = "pickaxe",
  614. toolLevelRequire = "stone",
  615. hasItsOwnItem = "Iron Block",
  616.  
  617. material = "metal",
  618.  
  619. texture = "ironblock"
  620. },
  621. DiamondBlock = {
  622. id = 57,
  623.  
  624. hardness = 5,
  625. drop = "DiamondBlock",
  626. toolRequire = "pickaxe",
  627. toolLevelRequire = "iron",
  628. hasItsOwnItem = "Diamond Block",
  629.  
  630. material = "metal",
  631.  
  632. texture = "diamondblock"
  633. },
  634. Obsidian = {
  635. hardness = 50,
  636. drop = "Obsidian",
  637. toolRequire = "pickaxe",
  638. toolLevelRequire = "diamond",
  639. hasItsOwnItem = true,
  640.  
  641. material = "stone",
  642.  
  643. texture = "obsidian"
  644. },
  645.  
  646.  
  647. Torch = {
  648. hardness = 0,
  649. drop = "Torch",
  650.  
  651. blocktype = "nonsolid",
  652.  
  653. facingPos = {
  654. CFrame.new(-1.3,0,0) * CFrame.Angles(0,0,math.rad(-15)),
  655. CFrame.new(1.3,0,0) * CFrame.Angles(0,0,math.rad(15)),
  656. CFrame.new(0,0,-1.3) * CFrame.Angles(math.rad(15),0,0),
  657. CFrame.new(0,0,1.3) * CFrame.Angles(math.rad(-15),0,0),
  658. CFrame.new(0,-0.5675,0)
  659. },
  660. facingPosDef = 5,
  661.  
  662. custom = "Torch",
  663. }
  664. }
  665.  
  666. end))
  667. ModuleScript4.Name = "ItemInfo"
  668. ModuleScript4.Parent = Folder0
  669. table.insert(cors,sandbox(ModuleScript4,function()
  670. local M_BI = require(script.Parent:WaitForChild("BlockInfo"))
  671.  
  672. local items = {
  673.  
  674. Stick = {
  675. id = 280,
  676. maxstack = 64,
  677. texture = "stick"
  678. },
  679.  
  680. Torch = {
  681. id = 50,
  682. maxstack = 64,
  683. texture = "torch",
  684. placeable = 1,
  685. },
  686.  
  687.  
  688.  
  689. Coal = {
  690. id = 263,
  691. maxstack = 64,
  692. texture = "coal"
  693. },
  694. Diamond = {
  695. id = 264,
  696. maxstack = 64,
  697. texture = "diamond"
  698. },
  699. IronIngot = {
  700. id = 265,
  701. maxstack = 64,
  702. texture = "ironingot",
  703. name = "Iron Ingot"
  704. },
  705.  
  706.  
  707. Brick = {
  708. id = 336,
  709. maxstack = 64,
  710. texture = "missing",
  711. name = "Brick",
  712. },
  713.  
  714.  
  715.  
  716. WoodenPickaxe = {
  717. id = 270,
  718. maxstack = 1,
  719. texture = "woodenpickaxe",
  720. level = "wooden",
  721. tooltype = "pickaxe",
  722. name = "Wooden Pickaxe"
  723. },
  724. StonePickaxe = {
  725. id = 274,
  726. maxstack = 1,
  727. texture = "stonepickaxe",
  728. level = "stone",
  729. tooltype = "pickaxe",
  730. name = "Stone Pickaxe"
  731. },
  732. IronPickaxe = {
  733. id = 257,
  734. maxstack = 1,
  735. texture = "ironpickaxe",
  736. level = "iron",
  737. tooltype = "pickaxe",
  738. name = "Iron Pickaxe"
  739. },
  740. DiamondPickaxe = {
  741. id = 278,
  742. maxstack = 1,
  743. texture = "diamondpickaxe",
  744. level = "diamond",
  745. tooltype = "pickaxe",
  746. name = "Diamond Pickaxe"
  747. },
  748.  
  749. WoodenAxe = {
  750. id = 271,
  751. maxstack = 1,
  752. texture = "woodenaxe",
  753. level = "wooden",
  754. tooltype = "axe",
  755. name = "Wooden Axe"
  756. },
  757. StoneAxe = {
  758. id = 275,
  759. maxstack = 1,
  760. texture = "stoneaxe",
  761. level = "stone",
  762. tooltype = "axe",
  763. name = "Stone Axe"
  764. },
  765. IronAxe = {
  766. id = 258,
  767. maxstack = 1,
  768. texture = "ironaxe",
  769. level = "iron",
  770. tooltype = "axe",
  771. name = "Iron Axe"
  772. },
  773. DiamondAxe = {
  774. id = 279,
  775. maxstack = 1,
  776. texture = "diamondaxe",
  777. level = "diamond",
  778. tooltype = "axe",
  779. name = "Diamond Axe"
  780. },
  781.  
  782. WoodenSword = {
  783. id = 268,
  784. maxstack = 1,
  785. texture = "woodensword",
  786. level = "wooden",
  787. tooltype = "sword",
  788. name = "Wooden Sword"
  789. },
  790. StoneSword = {
  791. id = 272,
  792. maxstack = 1,
  793. texture = "stonesword",
  794. level = "stone",
  795. tooltype = "sword",
  796. name = "Stone Sword"
  797. },
  798. IronSword = {
  799. id = 267,
  800. maxstack = 1,
  801. texture = "ironsword",
  802. level = "iron",
  803. tooltype = "sword",
  804. name = "Iron Sword"
  805. },
  806. DiamondSword = {
  807. id = 276,
  808. maxstack = 1,
  809. texture = "diamondsword",
  810. level = "diamond",
  811. tooltype = "sword",
  812. name = "Diamond Sword"
  813. },
  814.  
  815.  
  816.  
  817. Item = {
  818. maxstack = 64
  819. },
  820.  
  821. }
  822.  
  823. for i,v in pairs(M_BI) do
  824. if v.hasItsOwnItem and not items[i] then
  825. local item = {
  826. maxstack = 64,
  827. defaultname = (type(v.hasItsOwnItem) == "string") and v.hasItsOwnItem or i,
  828. block = i
  829. }
  830. items[i] = item
  831. end
  832. end
  833.  
  834. return items
  835.  
  836. end))
  837. ModuleScript5.Name = "Recipes"
  838. ModuleScript5.Parent = Folder0
  839. table.insert(cors,sandbox(ModuleScript5,function()
  840. local recipes = {
  841. OakPlanks = {
  842. "OakLog",nil,nil,
  843. nil,nil,nil,
  844. nil,nil,nil,
  845.  
  846. 4
  847. },
  848. CraftingTable = {
  849. "OakPlanks","OakPlanks",nil,
  850. "OakPlanks","OakPlanks",nil,
  851. nil,nil,nil
  852. },
  853. Furnace = {
  854. "Cobblestone","Cobblestone","Cobblestone",
  855. "Cobblestone",nil,"Cobblestone",
  856. "Cobblestone","Cobblestone","Cobblestone"
  857. },
  858. Chest = {
  859. "OakPlanks","OakPlanks","OakPlanks",
  860. "OakPlanks",nil,"OakPlanks",
  861. "OakPlanks","OakPlanks","OakPlanks"
  862. },
  863.  
  864.  
  865. Bricks = {
  866. "Brick","Brick",nil,
  867. "Brick","Brick",nil,
  868. nil,nil,nil
  869. },
  870.  
  871.  
  872. CoalBlock = {
  873. "Coal","Coal","Coal",
  874. "Coal","Coal","Coal",
  875. "Coal","Coal","Coal",
  876. },
  877. Coal = {
  878. "CoalBlock",nil,nil,
  879. nil,nil,nil,
  880. nil,nil,nil,
  881.  
  882. 9
  883. },
  884. IronBlock = {
  885. "IronIngot","IronIngot","IronIngot",
  886. "IronIngot","IronIngot","IronIngot",
  887. "IronIngot","IronIngot","IronIngot"
  888. },
  889. IronIngot = {
  890. "IronBlock",nil,nil,
  891. nil,nil,nil,
  892. nil,nil,nil,
  893.  
  894. 9
  895. },
  896. DiamondBlock = {
  897. "Diamond","Diamond","Diamond",
  898. "Diamond","Diamond","Diamond",
  899. "Diamond","Diamond","Diamond"
  900. },
  901. Diamond = {
  902. "DiamondBlock",nil,nil,
  903. nil,nil,nil,
  904. nil,nil,nil,
  905.  
  906. 9
  907. },
  908.  
  909.  
  910.  
  911. WoodenPickaxe = {
  912. "OakPlanks","OakPlanks","OakPlanks",
  913. nil,"Stick",nil,
  914. nil,"Stick",nil
  915. },
  916. StonePickaxe = {
  917. "Cobblestone","Cobblestone","Cobblestone",
  918. nil,"Stick",nil,
  919. nil,"Stick",nil
  920. },
  921. IronPickaxe = {
  922. "IronIngot","IronIngot","IronIngot",
  923. nil,"Stick",nil,
  924. nil,"Stick",nil
  925. },
  926. DiamondPickaxe = {
  927. "Diamond","Diamond","Diamond",
  928. nil,"Stick",nil,
  929. nil,"Stick",nil
  930. },
  931.  
  932. WoodenAxe = {
  933. "OakPlanks","OakPlanks",nil,
  934. "OakPlanks","Stick",nil,
  935. nil,"Stick",nil
  936. }, WoodenAxe = {
  937. "OakPlanks","OakPlanks",nil,
  938. "Stick","OakPlanks",nil,
  939. "Stick",nil,nil
  940. },
  941. StoneAxe = {
  942. "Cobblestone","Cobblestone",nil,
  943. "Cobblestone","Stick",nil,
  944. nil,"Stick",nil
  945. }, StoneAxe = {
  946. "Cobblestone","Cobblestone",nil,
  947. "Stick","Cobblestone",nil,
  948. "Stick",nil,nil
  949. },
  950. IronAxe = {
  951. "IronIngot","IronIngot",nil,
  952. "IronIngot","Stick",nil,
  953. nil,"Stick",nil
  954. }, IronAxe = {
  955. "IronIngot","IronIngot",nil,
  956. "Stick","IronIngot",nil,
  957. "Stick",nil,nil
  958. },
  959. DiamondAxe = {
  960. "Diamond","Diamond",nil,
  961. "Diamond","Stick",nil,
  962. nil,"Stick",nil
  963. }, DiamondAxe = {
  964. "Diamond","Diamond",nil,
  965. "Stick","Diamond",nil,
  966. "Stick",nil,nil
  967. },
  968.  
  969. WoodenSword = {
  970. "OakPlanks",nil,nil,
  971. "OakPlanks",nil,nil,
  972. "Stick",nil,nil
  973. },
  974. StoneSword = {
  975. "Cobblestone",nil,nil,
  976. "Cobblestone",nil,nil,
  977. "Stick",nil,nil
  978. },
  979. IronSword = {
  980. "IronIngot",nil,nil,
  981. "IronIngot",nil,nil,
  982. "Stick",nil,nil
  983. },
  984. DiamondSword = {
  985. "Diamond",nil,nil,
  986. "Diamond",nil,nil,
  987. "Stick",nil,nil
  988. },
  989.  
  990.  
  991.  
  992. Stick = {
  993. "OakPlanks",nil,nil,
  994. "OakPlanks",nil,nil,
  995. nil,nil,nil,
  996.  
  997. 4
  998. },
  999. Torch = {
  1000. "Coal",nil,nil,
  1001. "Stick",nil,nil,
  1002. nil,nil,nil,
  1003.  
  1004. 4
  1005. },
  1006. }
  1007. local unorderedRecipes = {
  1008.  
  1009. }
  1010.  
  1011. return {recipes,unorderedRecipes}
  1012.  
  1013. end))
  1014. ModuleScript6.Name = "ItemLevels"
  1015. ModuleScript6.Parent = Folder0
  1016. table.insert(cors,sandbox(ModuleScript6,function()
  1017. return {
  1018. speedMul = {
  1019. wooden = 2,
  1020. golden = 12,
  1021. stone = 4,
  1022. iron = 6,
  1023. diamond = 8,
  1024. },
  1025. pickaxe = {
  1026. "wooden",
  1027. "golden",
  1028. "stone",
  1029. "iron",
  1030. "diamond",
  1031. },
  1032. pickaxeR = {
  1033. wooden = 0,
  1034. golden = 1,
  1035. stone = 2,
  1036. iron = 3,
  1037. diamond = 4
  1038. },
  1039.  
  1040. axe = {
  1041. "wooden",
  1042. "golden",
  1043. "stone",
  1044. "iron",
  1045. "diamond",
  1046. },
  1047. axeR = {
  1048. wooden = 0,
  1049. golden = 1,
  1050. stone = 2,
  1051. iron = 3,
  1052. diamond = 4
  1053. },
  1054. }
  1055.  
  1056. end))
  1057. ModuleScript7.Name = "IDs"
  1058. ModuleScript7.Parent = Folder0
  1059. table.insert(cors,sandbox(ModuleScript7,function()
  1060. local ids = {
  1061. [0] = "Air",
  1062. [1] = "Stone",
  1063. [2] = "GrassBlock",
  1064. [3] = "Dirt",
  1065. [4] = "Cobblestone",
  1066. [5] = "OakPlanks",
  1067. [6] = "Sapling",
  1068. [7] = "Bedrock",
  1069. [8] = "Water",
  1070.  
  1071. [10] = "Lava",
  1072.  
  1073. [12] = "Sand",
  1074. [13] = "Gravel",
  1075.  
  1076. [15] = "IronOre",
  1077. [16] = "CoalOre",
  1078. [17] = "OakLog",
  1079. [18] = "Leaves",
  1080.  
  1081. [20] = "Glass",
  1082.  
  1083. [31] = "Grass",
  1084.  
  1085. [42] = "IronBlock",
  1086.  
  1087. [45] = "Bricks",
  1088.  
  1089. [49] = "Obsidian",
  1090. [50] = "Torch",
  1091. [51] = "Fire",
  1092.  
  1093. [54] = "Chest",
  1094.  
  1095. [56] = "DiamondOre",
  1096. [57] = "DiamondBlock",
  1097. [58] = "CraftingTable",
  1098.  
  1099. [61] = "Furnace",
  1100. [62] = "LitFurnace",
  1101.  
  1102. [64] = "Door"
  1103. }
  1104.  
  1105. for i,v in pairs(require(script.Parent:WaitForChild("ItemInfo"))) do
  1106. if v.id then
  1107. ids[v.id] = i
  1108. end
  1109. end
  1110. for i,v in pairs(require(script.Parent:WaitForChild("BlockInfo"))) do
  1111. if v.id then
  1112. ids[v.id] = i
  1113. end
  1114. end
  1115.  
  1116. return ids
  1117. end))
  1118. ModuleScript8.Name = "SmeltRecipes"
  1119. ModuleScript8.Parent = Folder0
  1120. table.insert(cors,sandbox(ModuleScript8,function()
  1121. return {
  1122.  
  1123. -- Smeltable
  1124. {
  1125. ["Cobblestone"] = "Stone",
  1126. ["Sand"] = "Glass",
  1127. ["Clay"] = "Brick",
  1128.  
  1129. ["IronOre"] = "IronIngot",
  1130. ["GoldOre"] = "GoldIngot",
  1131.  
  1132. ["DiamondOre"] = "Diamond", -- bruh
  1133. ["CoalOre"] = "Coal", -- bruh
  1134. ["RedstoneOre"] = "RedstoneDust", -- bruh
  1135.  
  1136. ["OakLog"] = "Coal",
  1137. },
  1138.  
  1139. -- Fuel
  1140. {
  1141. ["LavaBucket"] = 20000,
  1142.  
  1143. ["CoalBlock"] = 16000,
  1144. ["Coal"] = 1600,
  1145.  
  1146. ["OakPlanks"] = 300,
  1147. ["OakLog"] = 300,
  1148. ["CraftingTable"] = 300,
  1149. ["Chest"] = 300,
  1150.  
  1151. ["WoodenPickaxe"] = 200,
  1152. ["WoodenAxe"] = 200,
  1153. ["WoodenSword"] = 200,
  1154. ["WoodenShovel"] = 200,
  1155.  
  1156. ["Stick"] = 100,
  1157. }
  1158. }
  1159. end))
  1160. Folder9.Name = "ForLaterUse"
  1161. Folder9.Parent = mas
  1162. Sound10.Name = "Sand / Grass Step"
  1163. Sound10.Parent = Folder9
  1164. Sound10.SoundId = "rbxassetid://507863105"
  1165. Sound10.Volume = 1
  1166. Sound11.Parent = Folder9
  1167. Sound11.SoundId = "rbxassetid://1016978163"
  1168. Sound11.Volume = 1
  1169. Sound12.Parent = Folder9
  1170. Sound12.SoundId = "rbxassetid://507863457"
  1171. Sound12.Volume = 1
  1172. Sound13.Name = "Walking on Grass Sound"
  1173. Sound13.Parent = Folder9
  1174. Sound13.SoundId = "rbxassetid://379482039"
  1175. Sound13.Volume = 2
  1176. Sound14.Name = "Minecraft - Door Close"
  1177. Sound14.Parent = Folder9
  1178. Sound14.SoundId = "rbxassetid://180090455"
  1179. Sound15.Name = "Minecraft Sounds: Fall Big"
  1180. Sound15.Parent = Folder9
  1181. Sound15.SoundId = "rbxassetid://535681058"
  1182. Sound15.Volume = 1
  1183. Sound16.Name = "Minecraft Dirt/Gravel Step"
  1184. Sound16.Parent = Folder9
  1185. Sound16.SoundId = "rbxassetid://507864112"
  1186. Sound17.Name = "Minecraft Wood Step"
  1187. Sound17.Parent = Folder9
  1188. Sound17.SoundId = "rbxassetid://507863457"
  1189. Sound18.Name = "Minecraft Grass Step"
  1190. Sound18.Parent = Folder9
  1191. Sound18.SoundId = "rbxassetid://507863105"
  1192. Sound19.Name = "Minecraft Stone Step"
  1193. Sound19.Parent = Folder9
  1194. Sound19.SoundId = "rbxassetid://507863857"
  1195. Sound19.Volume = 1
  1196. Sky20.Name = "That old sky"
  1197. Sky20.Parent = Folder9
  1198. Sky20.MoonAngularSize = 9
  1199. Sky20.MoonTextureId = "rbxassetid://1176450669"
  1200. Sky20.SkyboxBk = "rbxassetid://2403410783"
  1201. Sky20.SkyboxDn = "rbxassetid://2403429771"
  1202. Sky20.SkyboxFt = "rbxassetid://2403410783"
  1203. Sky20.SkyboxLf = "rbxassetid://2403410783"
  1204. Sky20.SkyboxRt = "rbxassetid://2403410783"
  1205. Sky20.SkyboxUp = "rbxassetid://2403437847"
  1206. Sky20.StarCount = 0
  1207. Sky20.SunAngularSize = 10
  1208. Sky20.SunTextureId = "rbxassetid://55054494"
  1209. Folder21.Name = "GameRemotes"
  1210. Folder21.Parent = mas
  1211. RemoteFunction22.Name = "BreakBlock"
  1212. RemoteFunction22.Parent = Folder21
  1213. RemoteFunction23.Name = "PlaceBlock"
  1214. RemoteFunction23.Parent = Folder21
  1215. RemoteEvent24.Name = "RequestDamage"
  1216. RemoteEvent24.Parent = Folder21
  1217. RemoteEvent25.Name = "OnPlaceBlock"
  1218. RemoteEvent25.Parent = Folder21
  1219. RemoteEvent26.Name = "OnBreakBlock"
  1220. RemoteEvent26.Parent = Folder21
  1221. RemoteEvent27.Name = "PlaySound"
  1222. RemoteEvent27.Parent = Folder21
  1223. RemoteFunction28.Name = "CancelBlock"
  1224. RemoteFunction28.Parent = Folder21
  1225. RemoteFunction29.Name = "AcceptBreakBlock"
  1226. RemoteFunction29.Parent = Folder21
  1227. RemoteFunction30.Name = "MoveItem"
  1228. RemoteFunction30.Parent = Folder21
  1229. RemoteFunction31.Name = "DropItem"
  1230. RemoteFunction31.Parent = Folder21
  1231. RemoteFunction32.Name = "ChangeSlot"
  1232. RemoteFunction32.Parent = Folder21
  1233. RemoteFunction33.Name = "Attack"
  1234. RemoteFunction33.Parent = Folder21
  1235. RemoteEvent34.Name = "ServerChat"
  1236. RemoteEvent34.Parent = Folder21
  1237. RemoteEvent35.Name = "BeingAttacked"
  1238. RemoteEvent35.Parent = Folder21
  1239. RemoteFunction36.Name = "CraftItems"
  1240. RemoteFunction36.Parent = Folder21
  1241. RemoteFunction37.Name = "SortItem"
  1242. RemoteFunction37.Parent = Folder21
  1243. RemoteEvent38.Name = "StartRecordingPos"
  1244. RemoteEvent38.Parent = Folder21
  1245. Folder39.Name = "PhyGroups"
  1246. Folder39.Parent = mas
  1247. IntValue40.Name = "Particles"
  1248. IntValue40.Parent = Folder39
  1249. IntValue41.Name = "Character"
  1250. IntValue41.Parent = Folder39
  1251. IntValue42.Name = "World"
  1252. IntValue42.Parent = Folder39
  1253. Folder43.Name = "PlayerPositionSaves"
  1254. Folder43.Parent = mas
  1255. Folder44.Name = "VisualRemotes"
  1256. Folder44.Parent = mas
  1257. RemoteFunction45.Name = "GetChunk"
  1258. RemoteFunction45.Parent = Folder44
  1259. RemoteEvent46.Name = "BlockChanged"
  1260. RemoteEvent46.Parent = Folder44
  1261. RemoteEvent47.Name = "UpdateBlock"
  1262. RemoteEvent47.Parent = Folder44
  1263. RemoteEvent48.Name = "ChangeNeckWeld"
  1264. RemoteEvent48.Parent = Folder44
  1265. Vector3Value49.Name = "WorldSpawn"
  1266. Vector3Value49.Parent = mas
  1267. for i,v in pairs(mas:GetChildren()) do
  1268. v.Parent = game.ReplicatedStorage
  1269. pcall(function() v:MakeJoints() end)
  1270. end
  1271. mas:Destroy()
  1272. for i,v in pairs(cors) do
  1273. spawn(function()
  1274. pcall(v)
  1275. end)
  1276. end
  1277.  
  1278. --Converted with ttyyuu12345's model to script plugin v4
  1279. function sandbox(var,func)
  1280. local env = getfenv(func)
  1281. local newenv = setmetatable({},{
  1282. __index = function(self,k)
  1283. if k=="script" then
  1284. return var
  1285. else
  1286. return env[k]
  1287. end
  1288. end,
  1289. })
  1290. setfenv(func,newenv)
  1291. return func
  1292. end
  1293. cors = {}
  1294. mas = Instance.new("Model",game:GetService("Lighting"))
  1295. Folder0 = Instance.new("Folder")
  1296. Part1 = Instance.new("Part")
  1297. Decal2 = Instance.new("Decal")
  1298. Decal3 = Instance.new("Decal")
  1299. Decal4 = Instance.new("Decal")
  1300. Decal5 = Instance.new("Decal")
  1301. Decal6 = Instance.new("Decal")
  1302. Decal7 = Instance.new("Decal")
  1303. Part8 = Instance.new("Part")
  1304. Decal9 = Instance.new("Decal")
  1305. Decal10 = Instance.new("Decal")
  1306. Decal11 = Instance.new("Decal")
  1307. Decal12 = Instance.new("Decal")
  1308. Decal13 = Instance.new("Decal")
  1309. Decal14 = Instance.new("Decal")
  1310. Part15 = Instance.new("Part")
  1311. Decal16 = Instance.new("Decal")
  1312. Decal17 = Instance.new("Decal")
  1313. Decal18 = Instance.new("Decal")
  1314. Decal19 = Instance.new("Decal")
  1315. Decal20 = Instance.new("Decal")
  1316. Decal21 = Instance.new("Decal")
  1317. Part22 = Instance.new("Part")
  1318. Decal23 = Instance.new("Decal")
  1319. Decal24 = Instance.new("Decal")
  1320. Decal25 = Instance.new("Decal")
  1321. Decal26 = Instance.new("Decal")
  1322. Decal27 = Instance.new("Decal")
  1323. Decal28 = Instance.new("Decal")
  1324. Part29 = Instance.new("Part")
  1325. Decal30 = Instance.new("Decal")
  1326. Decal31 = Instance.new("Decal")
  1327. Decal32 = Instance.new("Decal")
  1328. Decal33 = Instance.new("Decal")
  1329. Decal34 = Instance.new("Decal")
  1330. Decal35 = Instance.new("Decal")
  1331. Part36 = Instance.new("Part")
  1332. Decal37 = Instance.new("Decal")
  1333. Decal38 = Instance.new("Decal")
  1334. Decal39 = Instance.new("Decal")
  1335. Decal40 = Instance.new("Decal")
  1336. Decal41 = Instance.new("Decal")
  1337. Decal42 = Instance.new("Decal")
  1338. Part43 = Instance.new("Part")
  1339. Decal44 = Instance.new("Decal")
  1340. Decal45 = Instance.new("Decal")
  1341. Decal46 = Instance.new("Decal")
  1342. Decal47 = Instance.new("Decal")
  1343. Decal48 = Instance.new("Decal")
  1344. Decal49 = Instance.new("Decal")
  1345. Part50 = Instance.new("Part")
  1346. Decal51 = Instance.new("Decal")
  1347. Decal52 = Instance.new("Decal")
  1348. Decal53 = Instance.new("Decal")
  1349. Decal54 = Instance.new("Decal")
  1350. Decal55 = Instance.new("Decal")
  1351. Decal56 = Instance.new("Decal")
  1352. Part57 = Instance.new("Part")
  1353. Decal58 = Instance.new("Decal")
  1354. Decal59 = Instance.new("Decal")
  1355. Decal60 = Instance.new("Decal")
  1356. Decal61 = Instance.new("Decal")
  1357. Decal62 = Instance.new("Decal")
  1358. Decal63 = Instance.new("Decal")
  1359. Model64 = Instance.new("Model")
  1360. Part65 = Instance.new("Part")
  1361. Part66 = Instance.new("Part")
  1362. Decal67 = Instance.new("Decal")
  1363. BlockMesh68 = Instance.new("BlockMesh")
  1364. Decal69 = Instance.new("Decal")
  1365. Part70 = Instance.new("Part")
  1366. Decal71 = Instance.new("Decal")
  1367. BlockMesh72 = Instance.new("BlockMesh")
  1368. Decal73 = Instance.new("Decal")
  1369. Part74 = Instance.new("Part")
  1370. Decal75 = Instance.new("Decal")
  1371. Decal76 = Instance.new("Decal")
  1372. Decal77 = Instance.new("Decal")
  1373. Decal78 = Instance.new("Decal")
  1374. Decal79 = Instance.new("Decal")
  1375. Decal80 = Instance.new("Decal")
  1376. Part81 = Instance.new("Part")
  1377. Decal82 = Instance.new("Decal")
  1378. Decal83 = Instance.new("Decal")
  1379. Decal84 = Instance.new("Decal")
  1380. Decal85 = Instance.new("Decal")
  1381. Decal86 = Instance.new("Decal")
  1382. Decal87 = Instance.new("Decal")
  1383. Part88 = Instance.new("Part")
  1384. Decal89 = Instance.new("Decal")
  1385. Decal90 = Instance.new("Decal")
  1386. Decal91 = Instance.new("Decal")
  1387. Decal92 = Instance.new("Decal")
  1388. Decal93 = Instance.new("Decal")
  1389. Decal94 = Instance.new("Decal")
  1390. Part95 = Instance.new("Part")
  1391. Decal96 = Instance.new("Decal")
  1392. Decal97 = Instance.new("Decal")
  1393. Decal98 = Instance.new("Decal")
  1394. Decal99 = Instance.new("Decal")
  1395. Decal100 = Instance.new("Decal")
  1396. Decal101 = Instance.new("Decal")
  1397. Part102 = Instance.new("Part")
  1398. Decal103 = Instance.new("Decal")
  1399. Decal104 = Instance.new("Decal")
  1400. Decal105 = Instance.new("Decal")
  1401. Decal106 = Instance.new("Decal")
  1402. Decal107 = Instance.new("Decal")
  1403. Decal108 = Instance.new("Decal")
  1404. Part109 = Instance.new("Part")
  1405. Decal110 = Instance.new("Decal")
  1406. Decal111 = Instance.new("Decal")
  1407. Decal112 = Instance.new("Decal")
  1408. Decal113 = Instance.new("Decal")
  1409. Decal114 = Instance.new("Decal")
  1410. Decal115 = Instance.new("Decal")
  1411. Part116 = Instance.new("Part")
  1412. Decal117 = Instance.new("Decal")
  1413. Decal118 = Instance.new("Decal")
  1414. Decal119 = Instance.new("Decal")
  1415. Decal120 = Instance.new("Decal")
  1416. Decal121 = Instance.new("Decal")
  1417. Decal122 = Instance.new("Decal")
  1418. Part123 = Instance.new("Part")
  1419. Decal124 = Instance.new("Decal")
  1420. Decal125 = Instance.new("Decal")
  1421. Decal126 = Instance.new("Decal")
  1422. Decal127 = Instance.new("Decal")
  1423. Decal128 = Instance.new("Decal")
  1424. Decal129 = Instance.new("Decal")
  1425. Part130 = Instance.new("Part")
  1426. Decal131 = Instance.new("Decal")
  1427. Decal132 = Instance.new("Decal")
  1428. Decal133 = Instance.new("Decal")
  1429. Decal134 = Instance.new("Decal")
  1430. Decal135 = Instance.new("Decal")
  1431. Decal136 = Instance.new("Decal")
  1432. Part137 = Instance.new("Part")
  1433. BlockMesh138 = Instance.new("BlockMesh")
  1434. Texture139 = Instance.new("Texture")
  1435. Texture140 = Instance.new("Texture")
  1436. Part141 = Instance.new("Part")
  1437. PointLight142 = Instance.new("PointLight")
  1438. Texture143 = Instance.new("Texture")
  1439. Texture144 = Instance.new("Texture")
  1440. Texture145 = Instance.new("Texture")
  1441. Texture146 = Instance.new("Texture")
  1442. Texture147 = Instance.new("Texture")
  1443. Texture148 = Instance.new("Texture")
  1444. Part149 = Instance.new("Part")
  1445. SurfaceGui150 = Instance.new("SurfaceGui")
  1446. Frame151 = Instance.new("Frame")
  1447. Frame152 = Instance.new("Frame")
  1448. Frame153 = Instance.new("Frame")
  1449. Frame154 = Instance.new("Frame")
  1450. Frame155 = Instance.new("Frame")
  1451. Frame156 = Instance.new("Frame")
  1452. Frame157 = Instance.new("Frame")
  1453. Frame158 = Instance.new("Frame")
  1454. Frame159 = Instance.new("Frame")
  1455. Frame160 = Instance.new("Frame")
  1456. Frame161 = Instance.new("Frame")
  1457. Frame162 = Instance.new("Frame")
  1458. SurfaceGui163 = Instance.new("SurfaceGui")
  1459. Frame164 = Instance.new("Frame")
  1460. Frame165 = Instance.new("Frame")
  1461. Frame166 = Instance.new("Frame")
  1462. Frame167 = Instance.new("Frame")
  1463. Frame168 = Instance.new("Frame")
  1464. Frame169 = Instance.new("Frame")
  1465. Frame170 = Instance.new("Frame")
  1466. Frame171 = Instance.new("Frame")
  1467. Frame172 = Instance.new("Frame")
  1468. Frame173 = Instance.new("Frame")
  1469. Frame174 = Instance.new("Frame")
  1470. Frame175 = Instance.new("Frame")
  1471. SurfaceGui176 = Instance.new("SurfaceGui")
  1472. Frame177 = Instance.new("Frame")
  1473. Frame178 = Instance.new("Frame")
  1474. Frame179 = Instance.new("Frame")
  1475. Frame180 = Instance.new("Frame")
  1476. Frame181 = Instance.new("Frame")
  1477. Frame182 = Instance.new("Frame")
  1478. Frame183 = Instance.new("Frame")
  1479. Frame184 = Instance.new("Frame")
  1480. Frame185 = Instance.new("Frame")
  1481. Frame186 = Instance.new("Frame")
  1482. Frame187 = Instance.new("Frame")
  1483. Frame188 = Instance.new("Frame")
  1484. SurfaceGui189 = Instance.new("SurfaceGui")
  1485. Frame190 = Instance.new("Frame")
  1486. Frame191 = Instance.new("Frame")
  1487. Frame192 = Instance.new("Frame")
  1488. Frame193 = Instance.new("Frame")
  1489. Frame194 = Instance.new("Frame")
  1490. Frame195 = Instance.new("Frame")
  1491. Frame196 = Instance.new("Frame")
  1492. Frame197 = Instance.new("Frame")
  1493. Frame198 = Instance.new("Frame")
  1494. Frame199 = Instance.new("Frame")
  1495. Frame200 = Instance.new("Frame")
  1496. Frame201 = Instance.new("Frame")
  1497. SurfaceGui202 = Instance.new("SurfaceGui")
  1498. Frame203 = Instance.new("Frame")
  1499. Frame204 = Instance.new("Frame")
  1500. Frame205 = Instance.new("Frame")
  1501. Frame206 = Instance.new("Frame")
  1502. Frame207 = Instance.new("Frame")
  1503. Frame208 = Instance.new("Frame")
  1504. Frame209 = Instance.new("Frame")
  1505. Frame210 = Instance.new("Frame")
  1506. Frame211 = Instance.new("Frame")
  1507. Frame212 = Instance.new("Frame")
  1508. Frame213 = Instance.new("Frame")
  1509. Frame214 = Instance.new("Frame")
  1510. SurfaceGui215 = Instance.new("SurfaceGui")
  1511. Frame216 = Instance.new("Frame")
  1512. Frame217 = Instance.new("Frame")
  1513. Frame218 = Instance.new("Frame")
  1514. Frame219 = Instance.new("Frame")
  1515. Frame220 = Instance.new("Frame")
  1516. Frame221 = Instance.new("Frame")
  1517. Frame222 = Instance.new("Frame")
  1518. Frame223 = Instance.new("Frame")
  1519. Frame224 = Instance.new("Frame")
  1520. Frame225 = Instance.new("Frame")
  1521. Frame226 = Instance.new("Frame")
  1522. Frame227 = Instance.new("Frame")
  1523. PointLight228 = Instance.new("PointLight")
  1524. UnionOperation229 = Instance.new("UnionOperation")
  1525. Folder0.Name = "Blocks"
  1526. Folder0.Parent = mas
  1527. Part1.Name = "Bedrock"
  1528. Part1.Parent = Folder0
  1529. Part1.CFrame = CFrame.new(-12.5, 1.49999905, 12.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1530. Part1.Position = Vector3.new(-12.5, 1.49999905, 12.5)
  1531. Part1.Size = Vector3.new(3, 3, 3)
  1532. Part1.Anchored = true
  1533. Part1.BottomSurface = Enum.SurfaceType.Smooth
  1534. Part1.TopSurface = Enum.SurfaceType.Smooth
  1535. Decal2.Parent = Part1
  1536. Decal2.Texture = "rbxassetid://75881126"
  1537. Decal2.Face = Enum.NormalId.Right
  1538. Decal3.Parent = Part1
  1539. Decal3.Texture = "rbxassetid://75881126"
  1540. Decal3.Face = Enum.NormalId.Back
  1541. Decal4.Parent = Part1
  1542. Decal4.Texture = "rbxassetid://75881126"
  1543. Decal4.Face = Enum.NormalId.Left
  1544. Decal5.Parent = Part1
  1545. Decal5.Texture = "rbxassetid://75881126"
  1546. Decal6.Parent = Part1
  1547. Decal6.Texture = "rbxassetid://75881126"
  1548. Decal6.Face = Enum.NormalId.Top
  1549. Decal7.Parent = Part1
  1550. Decal7.Texture = "rbxassetid://75881126"
  1551. Decal7.Face = Enum.NormalId.Bottom
  1552. Part8.Name = "Cobblestone"
  1553. Part8.Parent = Folder0
  1554. Part8.CFrame = CFrame.new(-3.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1555. Part8.Position = Vector3.new(-3.5, 4.50001383, 1.5)
  1556. Part8.Size = Vector3.new(3, 3, 3)
  1557. Part8.Anchored = true
  1558. Part8.BottomSurface = Enum.SurfaceType.Smooth
  1559. Part8.TopSurface = Enum.SurfaceType.Smooth
  1560. Decal9.Parent = Part8
  1561. Decal9.Texture = "rbxassetid://152572105"
  1562. Decal9.Face = Enum.NormalId.Right
  1563. Decal10.Parent = Part8
  1564. Decal10.Texture = "rbxassetid://152572105"
  1565. Decal10.Face = Enum.NormalId.Back
  1566. Decal11.Parent = Part8
  1567. Decal11.Texture = "rbxassetid://152572105"
  1568. Decal11.Face = Enum.NormalId.Left
  1569. Decal12.Parent = Part8
  1570. Decal12.Texture = "rbxassetid://152572105"
  1571. Decal13.Parent = Part8
  1572. Decal13.Texture = "rbxassetid://152572105"
  1573. Decal13.Face = Enum.NormalId.Top
  1574. Decal14.Parent = Part8
  1575. Decal14.Texture = "rbxassetid://152572105"
  1576. Decal14.Face = Enum.NormalId.Bottom
  1577. Part15.Name = "DiamondBlock"
  1578. Part15.Parent = Folder0
  1579. Part15.CFrame = CFrame.new(-12.5, 4.50001383, 8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1580. Part15.Position = Vector3.new(-12.5, 4.50001383, 8.5)
  1581. Part15.Size = Vector3.new(3, 3, 3)
  1582. Part15.Anchored = true
  1583. Part15.BottomSurface = Enum.SurfaceType.Smooth
  1584. Part15.TopSurface = Enum.SurfaceType.Smooth
  1585. Decal16.Parent = Part15
  1586. Decal16.Texture = "rbxassetid://152572109"
  1587. Decal16.Face = Enum.NormalId.Right
  1588. Decal17.Parent = Part15
  1589. Decal17.Texture = "rbxassetid://152572109"
  1590. Decal17.Face = Enum.NormalId.Back
  1591. Decal18.Parent = Part15
  1592. Decal18.Texture = "rbxassetid://152572109"
  1593. Decal18.Face = Enum.NormalId.Left
  1594. Decal19.Parent = Part15
  1595. Decal19.Texture = "rbxassetid://152572109"
  1596. Decal20.Parent = Part15
  1597. Decal20.Texture = "rbxassetid://152572109"
  1598. Decal20.Face = Enum.NormalId.Top
  1599. Decal21.Parent = Part15
  1600. Decal21.Texture = "rbxassetid://152572109"
  1601. Decal21.Face = Enum.NormalId.Bottom
  1602. Part22.Name = "Dirt"
  1603. Part22.Parent = Folder0
  1604. Part22.CFrame = CFrame.new(-9.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1605. Part22.Position = Vector3.new(-9.5, 4.50001383, 1.5)
  1606. Part22.Size = Vector3.new(3, 3, 3)
  1607. Part22.Anchored = true
  1608. Part22.BottomSurface = Enum.SurfaceType.Smooth
  1609. Part22.TopSurface = Enum.SurfaceType.Smooth
  1610. Decal23.Parent = Part22
  1611. Decal23.Texture = "rbxassetid://152569532"
  1612. Decal23.Face = Enum.NormalId.Right
  1613. Decal24.Parent = Part22
  1614. Decal24.Texture = "rbxassetid://152569532"
  1615. Decal24.Face = Enum.NormalId.Back
  1616. Decal25.Parent = Part22
  1617. Decal25.Texture = "rbxassetid://152569532"
  1618. Decal25.Face = Enum.NormalId.Left
  1619. Decal26.Parent = Part22
  1620. Decal26.Texture = "rbxassetid://152569532"
  1621. Decal27.Parent = Part22
  1622. Decal27.Texture = "rbxassetid://152569532"
  1623. Decal27.Face = Enum.NormalId.Top
  1624. Decal28.Parent = Part22
  1625. Decal28.Texture = "rbxassetid://152569532"
  1626. Decal28.Face = Enum.NormalId.Bottom
  1627. Part29.Name = "GrassBlock"
  1628. Part29.Parent = Folder0
  1629. Part29.CFrame = CFrame.new(-12.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1630. Part29.Position = Vector3.new(-12.5, 4.50001383, 1.5)
  1631. Part29.Size = Vector3.new(3, 3, 3)
  1632. Part29.Anchored = true
  1633. Part29.BottomSurface = Enum.SurfaceType.Smooth
  1634. Part29.TopSurface = Enum.SurfaceType.Smooth
  1635. Decal30.Parent = Part29
  1636. Decal30.Texture = "rbxassetid://96430337"
  1637. Decal30.Face = Enum.NormalId.Right
  1638. Decal31.Parent = Part29
  1639. Decal31.Texture = "rbxassetid://96430337"
  1640. Decal31.Face = Enum.NormalId.Back
  1641. Decal32.Parent = Part29
  1642. Decal32.Texture = "rbxassetid://96430337"
  1643. Decal32.Face = Enum.NormalId.Left
  1644. Decal33.Parent = Part29
  1645. Decal33.Texture = "rbxassetid://96430337"
  1646. Decal34.Parent = Part29
  1647. Decal34.Texture = "rbxassetid://96430265"
  1648. Decal34.Face = Enum.NormalId.Top
  1649. Decal35.Parent = Part29
  1650. Decal35.Texture = "rbxassetid://152569532"
  1651. Decal35.Face = Enum.NormalId.Bottom
  1652. Part36.Name = "IronBlock"
  1653. Part36.Parent = Folder0
  1654. Part36.CFrame = CFrame.new(-9.5, 4.50001383, 8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1655. Part36.Position = Vector3.new(-9.5, 4.50001383, 8.5)
  1656. Part36.Size = Vector3.new(3, 3, 3)
  1657. Part36.Anchored = true
  1658. Part36.BottomSurface = Enum.SurfaceType.Smooth
  1659. Part36.TopSurface = Enum.SurfaceType.Smooth
  1660. Decal37.Parent = Part36
  1661. Decal37.Texture = "rbxassetid://152572134"
  1662. Decal37.Face = Enum.NormalId.Right
  1663. Decal38.Parent = Part36
  1664. Decal38.Texture = "rbxassetid://152572134"
  1665. Decal38.Face = Enum.NormalId.Back
  1666. Decal39.Parent = Part36
  1667. Decal39.Texture = "rbxassetid://152572134"
  1668. Decal39.Face = Enum.NormalId.Left
  1669. Decal40.Parent = Part36
  1670. Decal40.Texture = "rbxassetid://152572134"
  1671. Decal41.Parent = Part36
  1672. Decal41.Texture = "rbxassetid://152572134"
  1673. Decal41.Face = Enum.NormalId.Top
  1674. Decal42.Parent = Part36
  1675. Decal42.Texture = "rbxassetid://152572134"
  1676. Decal42.Face = Enum.NormalId.Bottom
  1677. Part43.Name = "Leaves"
  1678. Part43.Parent = Folder0
  1679. Part43.CFrame = CFrame.new(0, 1.50001204, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1680. Part43.Position = Vector3.new(0, 1.50001204, 0)
  1681. Part43.Color = Color3.new(0.113725, 0.407843, 0.0784314)
  1682. Part43.Size = Vector3.new(3, 3, 3)
  1683. Part43.Anchored = true
  1684. Part43.BottomSurface = Enum.SurfaceType.Smooth
  1685. Part43.BrickColor = BrickColor.new("Parsley green")
  1686. Part43.Material = Enum.Material.Grass
  1687. Part43.TopSurface = Enum.SurfaceType.Smooth
  1688. Part43.brickColor = BrickColor.new("Parsley green")
  1689. Decal44.Parent = Part43
  1690. Decal44.Texture = "rbxassetid://140507911"
  1691. Decal44.Face = Enum.NormalId.Right
  1692. Decal45.Parent = Part43
  1693. Decal45.Texture = "rbxassetid://140507911"
  1694. Decal45.Face = Enum.NormalId.Back
  1695. Decal46.Parent = Part43
  1696. Decal46.Texture = "rbxassetid://140507911"
  1697. Decal46.Face = Enum.NormalId.Left
  1698. Decal47.Parent = Part43
  1699. Decal47.Texture = "rbxassetid://140507911"
  1700. Decal48.Parent = Part43
  1701. Decal48.Texture = "rbxassetid://140507911"
  1702. Decal48.Face = Enum.NormalId.Top
  1703. Decal49.Parent = Part43
  1704. Decal49.Texture = "rbxassetid://140507911"
  1705. Decal49.Face = Enum.NormalId.Bottom
  1706. Part50.Name = "OakPlanks"
  1707. Part50.Parent = Folder0
  1708. Part50.CFrame = CFrame.new(3.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1709. Part50.Position = Vector3.new(3.5, 4.50001383, 1.5)
  1710. Part50.Size = Vector3.new(3, 3, 3)
  1711. Part50.Anchored = true
  1712. Part50.BottomSurface = Enum.SurfaceType.Smooth
  1713. Part50.TopSurface = Enum.SurfaceType.Smooth
  1714. Decal51.Parent = Part50
  1715. Decal51.Texture = "rbxassetid://152572161"
  1716. Decal51.Face = Enum.NormalId.Right
  1717. Decal52.Parent = Part50
  1718. Decal52.Texture = "rbxassetid://152572161"
  1719. Decal52.Face = Enum.NormalId.Back
  1720. Decal53.Parent = Part50
  1721. Decal53.Texture = "rbxassetid://152572161"
  1722. Decal53.Face = Enum.NormalId.Left
  1723. Decal54.Parent = Part50
  1724. Decal54.Texture = "rbxassetid://152572161"
  1725. Decal55.Parent = Part50
  1726. Decal55.Texture = "rbxassetid://152572161"
  1727. Decal55.Face = Enum.NormalId.Top
  1728. Decal56.Parent = Part50
  1729. Decal56.Texture = "rbxassetid://152572161"
  1730. Decal56.Face = Enum.NormalId.Bottom
  1731. Part57.Name = "Stone"
  1732. Part57.Parent = Folder0
  1733. Part57.CFrame = CFrame.new(-6.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1734. Part57.Position = Vector3.new(-6.5, 4.50001383, 1.5)
  1735. Part57.Size = Vector3.new(3, 3, 3)
  1736. Part57.Anchored = true
  1737. Part57.BottomSurface = Enum.SurfaceType.Smooth
  1738. Part57.TopSurface = Enum.SurfaceType.Smooth
  1739. Decal58.Parent = Part57
  1740. Decal58.Texture = "rbxassetid://75880927"
  1741. Decal58.Face = Enum.NormalId.Right
  1742. Decal59.Parent = Part57
  1743. Decal59.Texture = "rbxassetid://75880927"
  1744. Decal59.Face = Enum.NormalId.Back
  1745. Decal60.Parent = Part57
  1746. Decal60.Texture = "rbxassetid://75880927"
  1747. Decal60.Face = Enum.NormalId.Left
  1748. Decal61.Parent = Part57
  1749. Decal61.Texture = "rbxassetid://75880927"
  1750. Decal62.Parent = Part57
  1751. Decal62.Texture = "rbxassetid://75880927"
  1752. Decal62.Face = Enum.NormalId.Top
  1753. Decal63.Parent = Part57
  1754. Decal63.Texture = "rbxassetid://75880927"
  1755. Decal63.Face = Enum.NormalId.Bottom
  1756. Model64.Name = "Grass"
  1757. Model64.Parent = Folder0
  1758. Model64.PrimaryPart = Part65
  1759. Part65.Name = "Base"
  1760. Part65.Parent = Model64
  1761. Part65.CFrame = CFrame.new(-4.47034836e-08, 4.50002289, -2.23517418e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1762. Part65.Position = Vector3.new(-4.47034836e-08, 4.50002289, -2.23517418e-08)
  1763. Part65.Transparency = 1
  1764. Part65.Size = Vector3.new(3, 3, 3)
  1765. Part65.BottomSurface = Enum.SurfaceType.Smooth
  1766. Part65.TopSurface = Enum.SurfaceType.Smooth
  1767. Part66.Parent = Model64
  1768. Part66.CFrame = CFrame.new(-4.47034836e-08, 4.50002289, 7.4505806e-09, 0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, 0.707106829)
  1769. Part66.Orientation = Vector3.new(0, -45, 0)
  1770. Part66.Position = Vector3.new(-4.47034836e-08, 4.50002289, 7.4505806e-09)
  1771. Part66.Rotation = Vector3.new(0, -45, 0)
  1772. Part66.Transparency = 1
  1773. Part66.Size = Vector3.new(3, 3, 1)
  1774. Part66.BottomSurface = Enum.SurfaceType.Smooth
  1775. Part66.TopSurface = Enum.SurfaceType.Smooth
  1776. Decal67.Name = "Grass"
  1777. Decal67.Parent = Part66
  1778. Decal67.Texture = "http://www.roblox.com/asset/?id=151787580"
  1779. BlockMesh68.Parent = Part66
  1780. BlockMesh68.Scale = Vector3.new(1, 1, 0)
  1781. Decal69.Name = "Grass"
  1782. Decal69.Parent = Part66
  1783. Decal69.Texture = "http://www.roblox.com/asset/?id=151787580"
  1784. Decal69.Face = Enum.NormalId.Back
  1785. Part70.Parent = Model64
  1786. Part70.CFrame = CFrame.new(-4.47034836e-08, 4.50002289, 0, -0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, -0.707106829)
  1787. Part70.Orientation = Vector3.new(0, -135, 0)
  1788. Part70.Position = Vector3.new(-4.47034836e-08, 4.50002289, 0)
  1789. Part70.Rotation = Vector3.new(-180, -45, -180)
  1790. Part70.Transparency = 1
  1791. Part70.Size = Vector3.new(3, 3, 1)
  1792. Part70.BottomSurface = Enum.SurfaceType.Smooth
  1793. Part70.TopSurface = Enum.SurfaceType.Smooth
  1794. Decal71.Name = "Grass"
  1795. Decal71.Parent = Part70
  1796. Decal71.Texture = "http://www.roblox.com/asset/?id=151787580"
  1797. BlockMesh72.Parent = Part70
  1798. BlockMesh72.Scale = Vector3.new(1, 1, 0)
  1799. Decal73.Name = "Grass"
  1800. Decal73.Parent = Part70
  1801. Decal73.Texture = "http://www.roblox.com/asset/?id=151787580"
  1802. Decal73.Face = Enum.NormalId.Back
  1803. Part74.Name = "Glass"
  1804. Part74.Parent = Folder0
  1805. Part74.CFrame = CFrame.new(-6.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1806. Part74.Position = Vector3.new(-6.5, 4.50001383, 1.5)
  1807. Part74.Transparency = 1
  1808. Part74.Size = Vector3.new(3, 3, 3)
  1809. Part74.Anchored = true
  1810. Part74.BottomSurface = Enum.SurfaceType.Smooth
  1811. Part74.TopSurface = Enum.SurfaceType.Smooth
  1812. Decal75.Parent = Part74
  1813. Decal75.Texture = "rbxassetid://152239003"
  1814. Decal75.Face = Enum.NormalId.Right
  1815. Decal76.Parent = Part74
  1816. Decal76.Texture = "rbxassetid://152239003"
  1817. Decal76.Face = Enum.NormalId.Back
  1818. Decal77.Parent = Part74
  1819. Decal77.Texture = "rbxassetid://152239003"
  1820. Decal77.Face = Enum.NormalId.Left
  1821. Decal78.Parent = Part74
  1822. Decal78.Texture = "rbxassetid://152239003"
  1823. Decal79.Parent = Part74
  1824. Decal79.Texture = "rbxassetid://152239003"
  1825. Decal79.Face = Enum.NormalId.Top
  1826. Decal80.Parent = Part74
  1827. Decal80.Texture = "rbxassetid://152239003"
  1828. Decal80.Face = Enum.NormalId.Bottom
  1829. Part81.Name = "OakLog"
  1830. Part81.Parent = Folder0
  1831. Part81.CFrame = CFrame.new(0, 1.50001204, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1832. Part81.Position = Vector3.new(0, 1.50001204, 0)
  1833. Part81.Size = Vector3.new(3, 3, 3)
  1834. Part81.Anchored = true
  1835. Part81.BottomSurface = Enum.SurfaceType.Smooth
  1836. Part81.TopSurface = Enum.SurfaceType.Smooth
  1837. Decal82.Parent = Part81
  1838. Decal82.Texture = "rbxassetid://3595677229"
  1839. Decal82.Face = Enum.NormalId.Right
  1840. Decal83.Parent = Part81
  1841. Decal83.Texture = "rbxassetid://3595677229"
  1842. Decal83.Face = Enum.NormalId.Back
  1843. Decal84.Parent = Part81
  1844. Decal84.Texture = "rbxassetid://3595677229"
  1845. Decal84.Face = Enum.NormalId.Left
  1846. Decal85.Parent = Part81
  1847. Decal85.Texture = "rbxassetid://3595677229"
  1848. Decal86.Parent = Part81
  1849. Decal86.Texture = "rbxassetid://3595694398"
  1850. Decal86.Face = Enum.NormalId.Top
  1851. Decal87.Parent = Part81
  1852. Decal87.Texture = "rbxassetid://3595694398"
  1853. Decal87.Face = Enum.NormalId.Bottom
  1854. Part88.Name = "Obsidian"
  1855. Part88.Parent = Folder0
  1856. Part88.CFrame = CFrame.new(0.5, 1.50001204, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1857. Part88.Position = Vector3.new(0.5, 1.50001204, -0.5)
  1858. Part88.Size = Vector3.new(3, 3, 3)
  1859. Part88.Anchored = true
  1860. Part88.BottomSurface = Enum.SurfaceType.Smooth
  1861. Part88.TopSurface = Enum.SurfaceType.Smooth
  1862. Decal89.Parent = Part88
  1863. Decal89.Texture = "rbxassetid://146215703"
  1864. Decal89.Face = Enum.NormalId.Right
  1865. Decal90.Parent = Part88
  1866. Decal90.Texture = "rbxassetid://146215703"
  1867. Decal90.Face = Enum.NormalId.Back
  1868. Decal91.Parent = Part88
  1869. Decal91.Texture = "rbxassetid://146215703"
  1870. Decal91.Face = Enum.NormalId.Left
  1871. Decal92.Parent = Part88
  1872. Decal92.Texture = "rbxassetid://146215703"
  1873. Decal93.Parent = Part88
  1874. Decal93.Texture = "rbxassetid://146215703"
  1875. Decal93.Face = Enum.NormalId.Top
  1876. Decal94.Parent = Part88
  1877. Decal94.Texture = "rbxassetid://146215703"
  1878. Decal94.Face = Enum.NormalId.Bottom
  1879. Part95.Name = "CraftingTable"
  1880. Part95.Parent = Folder0
  1881. Part95.CFrame = CFrame.new(-4.5, 7.50001001, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1882. Part95.Position = Vector3.new(-4.5, 7.50001001, -0.5)
  1883. Part95.Size = Vector3.new(3, 3, 3)
  1884. Part95.Anchored = true
  1885. Part95.BottomSurface = Enum.SurfaceType.Smooth
  1886. Part95.TopSurface = Enum.SurfaceType.Smooth
  1887. Decal96.Parent = Part95
  1888. Decal96.Texture = "http://www.roblox.com/asset/?id=151913790"
  1889. Decal96.Face = Enum.NormalId.Top
  1890. Decal97.Parent = Part95
  1891. Decal97.Texture = "http://www.roblox.com/asset/?id=151913772"
  1892. Decal97.Face = Enum.NormalId.Left
  1893. Decal98.Parent = Part95
  1894. Decal98.Texture = "http://www.roblox.com/asset/?id=151913772"
  1895. Decal98.Face = Enum.NormalId.Right
  1896. Decal99.Parent = Part95
  1897. Decal99.Texture = "rbxassetid://152572161"
  1898. Decal99.Face = Enum.NormalId.Bottom
  1899. Decal100.Parent = Part95
  1900. Decal100.Texture = "http://www.roblox.com/asset/?id=151913757"
  1901. Decal101.Parent = Part95
  1902. Decal101.Texture = "http://www.roblox.com/asset/?id=151913772"
  1903. Decal101.Face = Enum.NormalId.Back
  1904. Part102.Name = "Furnace"
  1905. Part102.Parent = Folder0
  1906. Part102.CFrame = CFrame.new(0.5, 1.50001597, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1907. Part102.Position = Vector3.new(0.5, 1.50001597, 0.5)
  1908. Part102.Size = Vector3.new(3, 3, 3)
  1909. Part102.Anchored = true
  1910. Part102.BottomSurface = Enum.SurfaceType.Smooth
  1911. Part102.TopSurface = Enum.SurfaceType.Smooth
  1912. Decal103.Parent = Part102
  1913. Decal103.Texture = "http://www.roblox.com/asset/?id=151920519"
  1914. Decal104.Parent = Part102
  1915. Decal104.Texture = "http://www.roblox.com/asset/?id=151920532"
  1916. Decal104.Face = Enum.NormalId.Top
  1917. Decal105.Parent = Part102
  1918. Decal105.Texture = "http://www.roblox.com/asset/?id=151920532"
  1919. Decal105.Face = Enum.NormalId.Left
  1920. Decal106.Parent = Part102
  1921. Decal106.Texture = "http://www.roblox.com/asset/?id=151920532"
  1922. Decal106.Face = Enum.NormalId.Right
  1923. Decal107.Parent = Part102
  1924. Decal107.Texture = "http://www.roblox.com/asset/?id=151920532"
  1925. Decal107.Face = Enum.NormalId.Back
  1926. Decal108.Parent = Part102
  1927. Decal108.Texture = "http://www.roblox.com/asset/?id=151920532"
  1928. Decal108.Face = Enum.NormalId.Bottom
  1929. Part109.Name = "DiamondOre"
  1930. Part109.Parent = Folder0
  1931. Part109.CFrame = CFrame.new(-3.5, 4.5, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1932. Part109.Position = Vector3.new(-3.5, 4.5, 1.5)
  1933. Part109.Size = Vector3.new(3, 3, 3)
  1934. Part109.Anchored = true
  1935. Part109.BottomSurface = Enum.SurfaceType.Smooth
  1936. Part109.TopSurface = Enum.SurfaceType.Smooth
  1937. Decal110.Parent = Part109
  1938. Decal110.Texture = "rbxassetid://152572119"
  1939. Decal110.Face = Enum.NormalId.Right
  1940. Decal111.Parent = Part109
  1941. Decal111.Texture = "rbxassetid://152572119"
  1942. Decal111.Face = Enum.NormalId.Back
  1943. Decal112.Parent = Part109
  1944. Decal112.Texture = "rbxassetid://152572119"
  1945. Decal112.Face = Enum.NormalId.Left
  1946. Decal113.Parent = Part109
  1947. Decal113.Texture = "rbxassetid://152572119"
  1948. Decal114.Parent = Part109
  1949. Decal114.Texture = "rbxassetid://152572119"
  1950. Decal114.Face = Enum.NormalId.Top
  1951. Decal115.Parent = Part109
  1952. Decal115.Texture = "rbxassetid://152572119"
  1953. Decal115.Face = Enum.NormalId.Bottom
  1954. Part116.Name = "CoalOre"
  1955. Part116.Parent = Folder0
  1956. Part116.CFrame = CFrame.new(0.5, 1.50001204, -5.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1957. Part116.Position = Vector3.new(0.5, 1.50001204, -5.5)
  1958. Part116.Size = Vector3.new(3, 3, 3)
  1959. Part116.Anchored = true
  1960. Part116.BottomSurface = Enum.SurfaceType.Smooth
  1961. Part116.TopSurface = Enum.SurfaceType.Smooth
  1962. Decal117.Parent = Part116
  1963. Decal117.Texture = "rbxassetid://152572101"
  1964. Decal117.Face = Enum.NormalId.Right
  1965. Decal118.Parent = Part116
  1966. Decal118.Texture = "rbxassetid://152572101"
  1967. Decal118.Face = Enum.NormalId.Back
  1968. Decal119.Parent = Part116
  1969. Decal119.Texture = "rbxassetid://152572101"
  1970. Decal119.Face = Enum.NormalId.Left
  1971. Decal120.Parent = Part116
  1972. Decal120.Texture = "rbxassetid://152572101"
  1973. Decal121.Parent = Part116
  1974. Decal121.Texture = "rbxassetid://152572101"
  1975. Decal121.Face = Enum.NormalId.Top
  1976. Decal122.Parent = Part116
  1977. Decal122.Texture = "rbxassetid://152572101"
  1978. Decal122.Face = Enum.NormalId.Bottom
  1979. Part123.Name = "IronOre"
  1980. Part123.Parent = Folder0
  1981. Part123.CFrame = CFrame.new(0.5, 1.50001204, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1982. Part123.Position = Vector3.new(0.5, 1.50001204, -0.5)
  1983. Part123.Size = Vector3.new(3, 3, 3)
  1984. Part123.Anchored = true
  1985. Part123.BottomSurface = Enum.SurfaceType.Smooth
  1986. Part123.TopSurface = Enum.SurfaceType.Smooth
  1987. Decal124.Parent = Part123
  1988. Decal124.Texture = "rbxassetid://152572136"
  1989. Decal124.Face = Enum.NormalId.Right
  1990. Decal125.Parent = Part123
  1991. Decal125.Texture = "rbxassetid://152572136"
  1992. Decal125.Face = Enum.NormalId.Back
  1993. Decal126.Parent = Part123
  1994. Decal126.Texture = "rbxassetid://152572136"
  1995. Decal126.Face = Enum.NormalId.Left
  1996. Decal127.Parent = Part123
  1997. Decal127.Texture = "rbxassetid://152572136"
  1998. Decal128.Parent = Part123
  1999. Decal128.Texture = "rbxassetid://152572136"
  2000. Decal128.Face = Enum.NormalId.Top
  2001. Decal129.Parent = Part123
  2002. Decal129.Texture = "rbxassetid://152572136"
  2003. Decal129.Face = Enum.NormalId.Bottom
  2004. Part130.Name = "Sand"
  2005. Part130.Parent = Folder0
  2006. Part130.CFrame = CFrame.new(0.5, 1.50001204, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2007. Part130.Position = Vector3.new(0.5, 1.50001204, -0.5)
  2008. Part130.Size = Vector3.new(3, 3, 3)
  2009. Part130.Anchored = true
  2010. Part130.BottomSurface = Enum.SurfaceType.Smooth
  2011. Part130.TopSurface = Enum.SurfaceType.Smooth
  2012. Decal131.Parent = Part130
  2013. Decal131.Texture = "rbxassetid://152572215"
  2014. Decal131.Face = Enum.NormalId.Right
  2015. Decal132.Parent = Part130
  2016. Decal132.Texture = "rbxassetid://152572215"
  2017. Decal132.Face = Enum.NormalId.Back
  2018. Decal133.Parent = Part130
  2019. Decal133.Texture = "rbxassetid://152572215"
  2020. Decal133.Face = Enum.NormalId.Left
  2021. Decal134.Parent = Part130
  2022. Decal134.Texture = "rbxassetid://152572215"
  2023. Decal135.Parent = Part130
  2024. Decal135.Texture = "rbxassetid://152572215"
  2025. Decal135.Face = Enum.NormalId.Top
  2026. Decal136.Parent = Part130
  2027. Decal136.Texture = "rbxassetid://152572215"
  2028. Decal136.Face = Enum.NormalId.Bottom
  2029. Part137.Name = "Water"
  2030. Part137.Parent = Folder0
  2031. Part137.CFrame = CFrame.new(440, 0.500007987, -205, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2032. Part137.Position = Vector3.new(440, 0.500007987, -205)
  2033. Part137.Transparency = 1
  2034. Part137.Size = Vector3.new(3, 3, 3)
  2035. Part137.Anchored = true
  2036. Part137.BottomSurface = Enum.SurfaceType.Smooth
  2037. Part137.CanCollide = false
  2038. Part137.TopSurface = Enum.SurfaceType.Smooth
  2039. BlockMesh138.Parent = Part137
  2040. BlockMesh138.Offset = Vector3.new(0, 1.35000002, 0)
  2041. BlockMesh138.Scale = Vector3.new(1, 0, 1)
  2042. Texture139.Name = "TexTop"
  2043. Texture139.Parent = Part137
  2044. Texture139.Texture = "rbxassetid://204384984"
  2045. Texture139.Transparency = 0.079999998211861
  2046. Texture139.Face = Enum.NormalId.Top
  2047. Texture139.StudsPerTileU = 3
  2048. Texture139.StudsPerTileV = 3
  2049. Texture140.Name = "TexBottom"
  2050. Texture140.Parent = Part137
  2051. Texture140.Texture = "rbxassetid://204384984"
  2052. Texture140.Transparency = 0.079999998211861
  2053. Texture140.Face = Enum.NormalId.Bottom
  2054. Texture140.StudsPerTileU = 3
  2055. Texture140.StudsPerTileV = 3
  2056. Part141.Name = "Lava"
  2057. Part141.Parent = Folder0
  2058. Part141.CFrame = CFrame.new(0, 1.50000095, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2059. Part141.Position = Vector3.new(0, 1.50000095, 0)
  2060. Part141.Transparency = 1
  2061. Part141.Size = Vector3.new(3, 3, 3)
  2062. Part141.Anchored = true
  2063. Part141.BottomSurface = Enum.SurfaceType.Smooth
  2064. Part141.CanCollide = false
  2065. Part141.TopSurface = Enum.SurfaceType.Smooth
  2066. PointLight142.Parent = Part141
  2067. PointLight142.Color = Color3.new(1, 0.741176, 0.513726)
  2068. PointLight142.Range = 16
  2069. PointLight142.Brightness = 0.60000002384186
  2070. PointLight142.Shadows = true
  2071. Texture143.Parent = Part141
  2072. Texture143.Texture = "rbxassetid://152572155"
  2073. Texture143.Transparency = 0.079999998211861
  2074. Texture143.Face = Enum.NormalId.Bottom
  2075. Texture143.StudsPerTileU = 3
  2076. Texture143.StudsPerTileV = 3
  2077. Texture144.Parent = Part141
  2078. Texture144.Texture = "rbxassetid://152572155"
  2079. Texture144.Transparency = 0.079999998211861
  2080. Texture144.Face = Enum.NormalId.Top
  2081. Texture144.StudsPerTileU = 3
  2082. Texture144.StudsPerTileV = 3
  2083. Texture145.Parent = Part141
  2084. Texture145.Texture = "rbxassetid://152572155"
  2085. Texture145.Transparency = 0.079999998211861
  2086. Texture145.Face = Enum.NormalId.Left
  2087. Texture145.StudsPerTileU = 3
  2088. Texture145.StudsPerTileV = 3
  2089. Texture146.Parent = Part141
  2090. Texture146.Texture = "rbxassetid://152572155"
  2091. Texture146.Transparency = 0.079999998211861
  2092. Texture146.Face = Enum.NormalId.Right
  2093. Texture146.StudsPerTileU = 3
  2094. Texture146.StudsPerTileV = 3
  2095. Texture147.Parent = Part141
  2096. Texture147.Texture = "rbxassetid://152572155"
  2097. Texture147.Transparency = 0.079999998211861
  2098. Texture147.Face = Enum.NormalId.Back
  2099. Texture147.StudsPerTileU = 3
  2100. Texture147.StudsPerTileV = 3
  2101. Texture148.Parent = Part141
  2102. Texture148.Texture = "rbxassetid://152572155"
  2103. Texture148.Transparency = 0.079999998211861
  2104. Texture148.StudsPerTileU = 3
  2105. Texture148.StudsPerTileV = 3
  2106. Part149.Name = "Torch"
  2107. Part149.Parent = Folder0
  2108. Part149.CFrame = CFrame.new(-17, 0.500003994, 5.29999924, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2109. Part149.Position = Vector3.new(-17, 0.500003994, 5.29999924)
  2110. Part149.Size = Vector3.new(0.375, 1.875, 0.375)
  2111. Part149.Anchored = true
  2112. Part149.BottomSurface = Enum.SurfaceType.Smooth
  2113. Part149.CanCollide = false
  2114. Part149.Material = Enum.Material.SmoothPlastic
  2115. Part149.TopSurface = Enum.SurfaceType.Smooth
  2116. SurfaceGui150.Parent = Part149
  2117. SurfaceGui150.ClipsDescendants = true
  2118. SurfaceGui150.CanvasSize = Vector2.new(4, 20)
  2119. SurfaceGui150.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  2120. Frame151.Name = "torch"
  2121. Frame151.Parent = SurfaceGui150
  2122. Frame151.Position = UDim2.new(0, -14, 0, -12)
  2123. Frame151.Size = UDim2.new(0, 32, 0, 32)
  2124. Frame151.BackgroundTransparency = 1
  2125. Frame151.BorderSizePixel = 0
  2126. Frame152.Parent = Frame151
  2127. Frame152.Position = UDim2.new(0.5, 0, 0.5625, 0)
  2128. Frame152.Size = UDim2.new(0.0625, 0, 0.4375, 0)
  2129. Frame152.BackgroundColor = BrickColor.new("Cocoa")
  2130. Frame152.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
  2131. Frame152.BorderSizePixel = 0
  2132. Frame153.Parent = Frame151
  2133. Frame153.Position = UDim2.new(0.5, 0, 0.5, 0)
  2134. Frame153.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2135. Frame153.BackgroundColor = BrickColor.new("Dirt brown")
  2136. Frame153.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
  2137. Frame153.BorderSizePixel = 0
  2138. Frame154.Parent = Frame151
  2139. Frame154.Position = UDim2.new(0.4375, 0, 0.5, 0)
  2140. Frame154.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2141. Frame154.BackgroundColor = BrickColor.new("Bronze")
  2142. Frame154.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
  2143. Frame154.BorderSizePixel = 0
  2144. Frame155.Parent = Frame151
  2145. Frame155.Position = UDim2.new(0.4375, 0, 0.5625, 0)
  2146. Frame155.Size = UDim2.new(0.0625, 0, 0.25, 0)
  2147. Frame155.BackgroundColor = BrickColor.new("Red flip/flop")
  2148. Frame155.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2149. Frame155.BorderSizePixel = 0
  2150. Frame156.Parent = Frame151
  2151. Frame156.Position = UDim2.new(0.4375, 0, 0.875, 0)
  2152. Frame156.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2153. Frame156.BackgroundColor = BrickColor.new("Red flip/flop")
  2154. Frame156.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2155. Frame156.BorderSizePixel = 0
  2156. Frame157.Parent = Frame151
  2157. Frame157.Position = UDim2.new(0.4375, 0, 0.8125, 0)
  2158. Frame157.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2159. Frame157.BackgroundColor = BrickColor.new("Earth orange")
  2160. Frame157.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2161. Frame157.BorderSizePixel = 0
  2162. Frame158.Parent = Frame151
  2163. Frame158.Position = UDim2.new(0.4375, 0, 0.9375, 0)
  2164. Frame158.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2165. Frame158.BackgroundColor = BrickColor.new("Earth orange")
  2166. Frame158.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2167. Frame158.BorderSizePixel = 0
  2168. Frame159.Parent = Frame151
  2169. Frame159.Position = UDim2.new(0.5, 0, 0.4375, 0)
  2170. Frame159.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2171. Frame159.BackgroundColor = BrickColor.new("Institutional white")
  2172. Frame159.BackgroundColor3 = Color3.new(1, 1, 1)
  2173. Frame159.BorderSizePixel = 0
  2174. Frame160.Parent = Frame151
  2175. Frame160.Position = UDim2.new(0.4375, 0, 0.4375, 0)
  2176. Frame160.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2177. Frame160.BackgroundColor = BrickColor.new("Light yellow")
  2178. Frame160.BackgroundColor3 = Color3.new(1, 1, 0.592157)
  2179. Frame160.BorderSizePixel = 0
  2180. Frame161.Parent = Frame151
  2181. Frame161.Position = UDim2.new(0.5, 0, 0.375, 0)
  2182. Frame161.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2183. Frame161.BackgroundColor = BrickColor.new("Deep orange")
  2184. Frame161.BackgroundColor3 = Color3.new(1, 0.560784, 0)
  2185. Frame161.BorderSizePixel = 0
  2186. Frame162.Parent = Frame151
  2187. Frame162.Position = UDim2.new(0.4375, 0, 0.375, 0)
  2188. Frame162.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2189. Frame162.BackgroundColor = BrickColor.new("New Yeller")
  2190. Frame162.BackgroundColor3 = Color3.new(1, 0.847059, 0)
  2191. Frame162.BorderSizePixel = 0
  2192. SurfaceGui163.Parent = Part149
  2193. SurfaceGui163.Face = Enum.NormalId.Right
  2194. SurfaceGui163.ClipsDescendants = true
  2195. SurfaceGui163.CanvasSize = Vector2.new(4, 20)
  2196. SurfaceGui163.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  2197. Frame164.Name = "torch"
  2198. Frame164.Parent = SurfaceGui163
  2199. Frame164.Position = UDim2.new(0, -14, 0, -12)
  2200. Frame164.Size = UDim2.new(0, 32, 0, 32)
  2201. Frame164.BackgroundTransparency = 1
  2202. Frame164.BorderSizePixel = 0
  2203. Frame165.Parent = Frame164
  2204. Frame165.Position = UDim2.new(0.5, 0, 0.5625, 0)
  2205. Frame165.Size = UDim2.new(0.0625, 0, 0.4375, 0)
  2206. Frame165.BackgroundColor = BrickColor.new("Cocoa")
  2207. Frame165.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
  2208. Frame165.BorderSizePixel = 0
  2209. Frame166.Parent = Frame164
  2210. Frame166.Position = UDim2.new(0.5, 0, 0.5, 0)
  2211. Frame166.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2212. Frame166.BackgroundColor = BrickColor.new("Dirt brown")
  2213. Frame166.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
  2214. Frame166.BorderSizePixel = 0
  2215. Frame167.Parent = Frame164
  2216. Frame167.Position = UDim2.new(0.4375, 0, 0.5, 0)
  2217. Frame167.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2218. Frame167.BackgroundColor = BrickColor.new("Bronze")
  2219. Frame167.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
  2220. Frame167.BorderSizePixel = 0
  2221. Frame168.Parent = Frame164
  2222. Frame168.Position = UDim2.new(0.4375, 0, 0.5625, 0)
  2223. Frame168.Size = UDim2.new(0.0625, 0, 0.25, 0)
  2224. Frame168.BackgroundColor = BrickColor.new("Red flip/flop")
  2225. Frame168.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2226. Frame168.BorderSizePixel = 0
  2227. Frame169.Parent = Frame164
  2228. Frame169.Position = UDim2.new(0.4375, 0, 0.875, 0)
  2229. Frame169.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2230. Frame169.BackgroundColor = BrickColor.new("Red flip/flop")
  2231. Frame169.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2232. Frame169.BorderSizePixel = 0
  2233. Frame170.Parent = Frame164
  2234. Frame170.Position = UDim2.new(0.4375, 0, 0.8125, 0)
  2235. Frame170.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2236. Frame170.BackgroundColor = BrickColor.new("Earth orange")
  2237. Frame170.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2238. Frame170.BorderSizePixel = 0
  2239. Frame171.Parent = Frame164
  2240. Frame171.Position = UDim2.new(0.4375, 0, 0.9375, 0)
  2241. Frame171.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2242. Frame171.BackgroundColor = BrickColor.new("Earth orange")
  2243. Frame171.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2244. Frame171.BorderSizePixel = 0
  2245. Frame172.Parent = Frame164
  2246. Frame172.Position = UDim2.new(0.5, 0, 0.4375, 0)
  2247. Frame172.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2248. Frame172.BackgroundColor = BrickColor.new("Institutional white")
  2249. Frame172.BackgroundColor3 = Color3.new(1, 1, 1)
  2250. Frame172.BorderSizePixel = 0
  2251. Frame173.Parent = Frame164
  2252. Frame173.Position = UDim2.new(0.4375, 0, 0.4375, 0)
  2253. Frame173.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2254. Frame173.BackgroundColor = BrickColor.new("Light yellow")
  2255. Frame173.BackgroundColor3 = Color3.new(1, 1, 0.592157)
  2256. Frame173.BorderSizePixel = 0
  2257. Frame174.Parent = Frame164
  2258. Frame174.Position = UDim2.new(0.5, 0, 0.375, 0)
  2259. Frame174.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2260. Frame174.BackgroundColor = BrickColor.new("Deep orange")
  2261. Frame174.BackgroundColor3 = Color3.new(1, 0.560784, 0)
  2262. Frame174.BorderSizePixel = 0
  2263. Frame175.Parent = Frame164
  2264. Frame175.Position = UDim2.new(0.4375, 0, 0.375, 0)
  2265. Frame175.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2266. Frame175.BackgroundColor = BrickColor.new("New Yeller")
  2267. Frame175.BackgroundColor3 = Color3.new(1, 0.847059, 0)
  2268. Frame175.BorderSizePixel = 0
  2269. SurfaceGui176.Parent = Part149
  2270. SurfaceGui176.Face = Enum.NormalId.Left
  2271. SurfaceGui176.ClipsDescendants = true
  2272. SurfaceGui176.CanvasSize = Vector2.new(4, 20)
  2273. SurfaceGui176.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  2274. Frame177.Name = "torch"
  2275. Frame177.Parent = SurfaceGui176
  2276. Frame177.Position = UDim2.new(0, -14, 0, -12)
  2277. Frame177.Size = UDim2.new(0, 32, 0, 32)
  2278. Frame177.BackgroundTransparency = 1
  2279. Frame177.BorderSizePixel = 0
  2280. Frame178.Parent = Frame177
  2281. Frame178.Position = UDim2.new(0.5, 0, 0.5625, 0)
  2282. Frame178.Size = UDim2.new(0.0625, 0, 0.4375, 0)
  2283. Frame178.BackgroundColor = BrickColor.new("Cocoa")
  2284. Frame178.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
  2285. Frame178.BorderSizePixel = 0
  2286. Frame179.Parent = Frame177
  2287. Frame179.Position = UDim2.new(0.5, 0, 0.5, 0)
  2288. Frame179.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2289. Frame179.BackgroundColor = BrickColor.new("Dirt brown")
  2290. Frame179.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
  2291. Frame179.BorderSizePixel = 0
  2292. Frame180.Parent = Frame177
  2293. Frame180.Position = UDim2.new(0.4375, 0, 0.5, 0)
  2294. Frame180.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2295. Frame180.BackgroundColor = BrickColor.new("Bronze")
  2296. Frame180.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
  2297. Frame180.BorderSizePixel = 0
  2298. Frame181.Parent = Frame177
  2299. Frame181.Position = UDim2.new(0.4375, 0, 0.5625, 0)
  2300. Frame181.Size = UDim2.new(0.0625, 0, 0.25, 0)
  2301. Frame181.BackgroundColor = BrickColor.new("Red flip/flop")
  2302. Frame181.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2303. Frame181.BorderSizePixel = 0
  2304. Frame182.Parent = Frame177
  2305. Frame182.Position = UDim2.new(0.4375, 0, 0.875, 0)
  2306. Frame182.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2307. Frame182.BackgroundColor = BrickColor.new("Red flip/flop")
  2308. Frame182.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2309. Frame182.BorderSizePixel = 0
  2310. Frame183.Parent = Frame177
  2311. Frame183.Position = UDim2.new(0.4375, 0, 0.8125, 0)
  2312. Frame183.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2313. Frame183.BackgroundColor = BrickColor.new("Earth orange")
  2314. Frame183.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2315. Frame183.BorderSizePixel = 0
  2316. Frame184.Parent = Frame177
  2317. Frame184.Position = UDim2.new(0.4375, 0, 0.9375, 0)
  2318. Frame184.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2319. Frame184.BackgroundColor = BrickColor.new("Earth orange")
  2320. Frame184.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2321. Frame184.BorderSizePixel = 0
  2322. Frame185.Parent = Frame177
  2323. Frame185.Position = UDim2.new(0.5, 0, 0.4375, 0)
  2324. Frame185.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2325. Frame185.BackgroundColor = BrickColor.new("Institutional white")
  2326. Frame185.BackgroundColor3 = Color3.new(1, 1, 1)
  2327. Frame185.BorderSizePixel = 0
  2328. Frame186.Parent = Frame177
  2329. Frame186.Position = UDim2.new(0.4375, 0, 0.4375, 0)
  2330. Frame186.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2331. Frame186.BackgroundColor = BrickColor.new("Light yellow")
  2332. Frame186.BackgroundColor3 = Color3.new(1, 1, 0.592157)
  2333. Frame186.BorderSizePixel = 0
  2334. Frame187.Parent = Frame177
  2335. Frame187.Position = UDim2.new(0.5, 0, 0.375, 0)
  2336. Frame187.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2337. Frame187.BackgroundColor = BrickColor.new("Deep orange")
  2338. Frame187.BackgroundColor3 = Color3.new(1, 0.560784, 0)
  2339. Frame187.BorderSizePixel = 0
  2340. Frame188.Parent = Frame177
  2341. Frame188.Position = UDim2.new(0.4375, 0, 0.375, 0)
  2342. Frame188.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2343. Frame188.BackgroundColor = BrickColor.new("New Yeller")
  2344. Frame188.BackgroundColor3 = Color3.new(1, 0.847059, 0)
  2345. Frame188.BorderSizePixel = 0
  2346. SurfaceGui189.Parent = Part149
  2347. SurfaceGui189.Face = Enum.NormalId.Back
  2348. SurfaceGui189.ClipsDescendants = true
  2349. SurfaceGui189.CanvasSize = Vector2.new(4, 20)
  2350. SurfaceGui189.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  2351. Frame190.Name = "torch"
  2352. Frame190.Parent = SurfaceGui189
  2353. Frame190.Position = UDim2.new(0, -14, 0, -12)
  2354. Frame190.Size = UDim2.new(0, 32, 0, 32)
  2355. Frame190.BackgroundTransparency = 1
  2356. Frame190.BorderSizePixel = 0
  2357. Frame191.Parent = Frame190
  2358. Frame191.Position = UDim2.new(0.5, 0, 0.5625, 0)
  2359. Frame191.Size = UDim2.new(0.0625, 0, 0.4375, 0)
  2360. Frame191.BackgroundColor = BrickColor.new("Cocoa")
  2361. Frame191.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
  2362. Frame191.BorderSizePixel = 0
  2363. Frame192.Parent = Frame190
  2364. Frame192.Position = UDim2.new(0.5, 0, 0.5, 0)
  2365. Frame192.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2366. Frame192.BackgroundColor = BrickColor.new("Dirt brown")
  2367. Frame192.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
  2368. Frame192.BorderSizePixel = 0
  2369. Frame193.Parent = Frame190
  2370. Frame193.Position = UDim2.new(0.4375, 0, 0.5, 0)
  2371. Frame193.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2372. Frame193.BackgroundColor = BrickColor.new("Bronze")
  2373. Frame193.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
  2374. Frame193.BorderSizePixel = 0
  2375. Frame194.Parent = Frame190
  2376. Frame194.Position = UDim2.new(0.4375, 0, 0.5625, 0)
  2377. Frame194.Size = UDim2.new(0.0625, 0, 0.25, 0)
  2378. Frame194.BackgroundColor = BrickColor.new("Red flip/flop")
  2379. Frame194.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2380. Frame194.BorderSizePixel = 0
  2381. Frame195.Parent = Frame190
  2382. Frame195.Position = UDim2.new(0.4375, 0, 0.875, 0)
  2383. Frame195.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2384. Frame195.BackgroundColor = BrickColor.new("Red flip/flop")
  2385. Frame195.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2386. Frame195.BorderSizePixel = 0
  2387. Frame196.Parent = Frame190
  2388. Frame196.Position = UDim2.new(0.4375, 0, 0.8125, 0)
  2389. Frame196.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2390. Frame196.BackgroundColor = BrickColor.new("Earth orange")
  2391. Frame196.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2392. Frame196.BorderSizePixel = 0
  2393. Frame197.Parent = Frame190
  2394. Frame197.Position = UDim2.new(0.4375, 0, 0.9375, 0)
  2395. Frame197.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2396. Frame197.BackgroundColor = BrickColor.new("Earth orange")
  2397. Frame197.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2398. Frame197.BorderSizePixel = 0
  2399. Frame198.Parent = Frame190
  2400. Frame198.Position = UDim2.new(0.5, 0, 0.4375, 0)
  2401. Frame198.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2402. Frame198.BackgroundColor = BrickColor.new("Institutional white")
  2403. Frame198.BackgroundColor3 = Color3.new(1, 1, 1)
  2404. Frame198.BorderSizePixel = 0
  2405. Frame199.Parent = Frame190
  2406. Frame199.Position = UDim2.new(0.4375, 0, 0.4375, 0)
  2407. Frame199.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2408. Frame199.BackgroundColor = BrickColor.new("Light yellow")
  2409. Frame199.BackgroundColor3 = Color3.new(1, 1, 0.592157)
  2410. Frame199.BorderSizePixel = 0
  2411. Frame200.Parent = Frame190
  2412. Frame200.Position = UDim2.new(0.5, 0, 0.375, 0)
  2413. Frame200.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2414. Frame200.BackgroundColor = BrickColor.new("Deep orange")
  2415. Frame200.BackgroundColor3 = Color3.new(1, 0.560784, 0)
  2416. Frame200.BorderSizePixel = 0
  2417. Frame201.Parent = Frame190
  2418. Frame201.Position = UDim2.new(0.4375, 0, 0.375, 0)
  2419. Frame201.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2420. Frame201.BackgroundColor = BrickColor.new("New Yeller")
  2421. Frame201.BackgroundColor3 = Color3.new(1, 0.847059, 0)
  2422. Frame201.BorderSizePixel = 0
  2423. SurfaceGui202.Parent = Part149
  2424. SurfaceGui202.Face = Enum.NormalId.Top
  2425. SurfaceGui202.ClipsDescendants = true
  2426. SurfaceGui202.CanvasSize = Vector2.new(4, 4)
  2427. SurfaceGui202.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  2428. Frame203.Name = "torch"
  2429. Frame203.Parent = SurfaceGui202
  2430. Frame203.Position = UDim2.new(0, -14, 0, -12)
  2431. Frame203.Size = UDim2.new(0, 32, 0, 32)
  2432. Frame203.BackgroundTransparency = 1
  2433. Frame203.BorderSizePixel = 0
  2434. Frame204.Parent = Frame203
  2435. Frame204.Position = UDim2.new(0.5, 0, 0.5625, 0)
  2436. Frame204.Size = UDim2.new(0.0625, 0, 0.4375, 0)
  2437. Frame204.BackgroundColor = BrickColor.new("Cocoa")
  2438. Frame204.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
  2439. Frame204.BorderSizePixel = 0
  2440. Frame205.Parent = Frame203
  2441. Frame205.Position = UDim2.new(0.5, 0, 0.5, 0)
  2442. Frame205.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2443. Frame205.BackgroundColor = BrickColor.new("Dirt brown")
  2444. Frame205.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
  2445. Frame205.BorderSizePixel = 0
  2446. Frame206.Parent = Frame203
  2447. Frame206.Position = UDim2.new(0.4375, 0, 0.5, 0)
  2448. Frame206.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2449. Frame206.BackgroundColor = BrickColor.new("Bronze")
  2450. Frame206.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
  2451. Frame206.BorderSizePixel = 0
  2452. Frame207.Parent = Frame203
  2453. Frame207.Position = UDim2.new(0.4375, 0, 0.5625, 0)
  2454. Frame207.Size = UDim2.new(0.0625, 0, 0.25, 0)
  2455. Frame207.BackgroundColor = BrickColor.new("Red flip/flop")
  2456. Frame207.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2457. Frame207.BorderSizePixel = 0
  2458. Frame208.Parent = Frame203
  2459. Frame208.Position = UDim2.new(0.4375, 0, 0.875, 0)
  2460. Frame208.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2461. Frame208.BackgroundColor = BrickColor.new("Red flip/flop")
  2462. Frame208.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2463. Frame208.BorderSizePixel = 0
  2464. Frame209.Parent = Frame203
  2465. Frame209.Position = UDim2.new(0.4375, 0, 0.8125, 0)
  2466. Frame209.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2467. Frame209.BackgroundColor = BrickColor.new("Earth orange")
  2468. Frame209.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2469. Frame209.BorderSizePixel = 0
  2470. Frame210.Parent = Frame203
  2471. Frame210.Position = UDim2.new(0.4375, 0, 0.9375, 0)
  2472. Frame210.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2473. Frame210.BackgroundColor = BrickColor.new("Earth orange")
  2474. Frame210.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2475. Frame210.BorderSizePixel = 0
  2476. Frame211.Parent = Frame203
  2477. Frame211.Position = UDim2.new(0.5, 0, 0.4375, 0)
  2478. Frame211.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2479. Frame211.BackgroundColor = BrickColor.new("Institutional white")
  2480. Frame211.BackgroundColor3 = Color3.new(1, 1, 1)
  2481. Frame211.BorderSizePixel = 0
  2482. Frame212.Parent = Frame203
  2483. Frame212.Position = UDim2.new(0.4375, 0, 0.4375, 0)
  2484. Frame212.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2485. Frame212.BackgroundColor = BrickColor.new("Light yellow")
  2486. Frame212.BackgroundColor3 = Color3.new(1, 1, 0.592157)
  2487. Frame212.BorderSizePixel = 0
  2488. Frame213.Parent = Frame203
  2489. Frame213.Position = UDim2.new(0.5, 0, 0.375, 0)
  2490. Frame213.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2491. Frame213.BackgroundColor = BrickColor.new("Deep orange")
  2492. Frame213.BackgroundColor3 = Color3.new(1, 0.560784, 0)
  2493. Frame213.BorderSizePixel = 0
  2494. Frame214.Parent = Frame203
  2495. Frame214.Position = UDim2.new(0.4375, 0, 0.375, 0)
  2496. Frame214.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2497. Frame214.BackgroundColor = BrickColor.new("New Yeller")
  2498. Frame214.BackgroundColor3 = Color3.new(1, 0.847059, 0)
  2499. Frame214.BorderSizePixel = 0
  2500. SurfaceGui215.Parent = Part149
  2501. SurfaceGui215.Face = Enum.NormalId.Bottom
  2502. SurfaceGui215.ClipsDescendants = true
  2503. SurfaceGui215.CanvasSize = Vector2.new(4, 4)
  2504. SurfaceGui215.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  2505. Frame216.Name = "torch"
  2506. Frame216.Parent = SurfaceGui215
  2507. Frame216.Position = UDim2.new(0, -14, 0, -28)
  2508. Frame216.Size = UDim2.new(0, 32, 0, 32)
  2509. Frame216.BackgroundTransparency = 1
  2510. Frame216.BorderSizePixel = 0
  2511. Frame217.Parent = Frame216
  2512. Frame217.Position = UDim2.new(0.5, 0, 0.5625, 0)
  2513. Frame217.Size = UDim2.new(0.0625, 0, 0.4375, 0)
  2514. Frame217.BackgroundColor = BrickColor.new("Cocoa")
  2515. Frame217.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
  2516. Frame217.BorderSizePixel = 0
  2517. Frame218.Parent = Frame216
  2518. Frame218.Position = UDim2.new(0.5, 0, 0.5, 0)
  2519. Frame218.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2520. Frame218.BackgroundColor = BrickColor.new("Dirt brown")
  2521. Frame218.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
  2522. Frame218.BorderSizePixel = 0
  2523. Frame219.Parent = Frame216
  2524. Frame219.Position = UDim2.new(0.4375, 0, 0.5, 0)
  2525. Frame219.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2526. Frame219.BackgroundColor = BrickColor.new("Bronze")
  2527. Frame219.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
  2528. Frame219.BorderSizePixel = 0
  2529. Frame220.Parent = Frame216
  2530. Frame220.Position = UDim2.new(0.4375, 0, 0.5625, 0)
  2531. Frame220.Size = UDim2.new(0.0625, 0, 0.25, 0)
  2532. Frame220.BackgroundColor = BrickColor.new("Red flip/flop")
  2533. Frame220.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2534. Frame220.BorderSizePixel = 0
  2535. Frame221.Parent = Frame216
  2536. Frame221.Position = UDim2.new(0.4375, 0, 0.875, 0)
  2537. Frame221.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2538. Frame221.BackgroundColor = BrickColor.new("Red flip/flop")
  2539. Frame221.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
  2540. Frame221.BorderSizePixel = 0
  2541. Frame222.Parent = Frame216
  2542. Frame222.Position = UDim2.new(0.4375, 0, 0.8125, 0)
  2543. Frame222.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2544. Frame222.BackgroundColor = BrickColor.new("Earth orange")
  2545. Frame222.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2546. Frame222.BorderSizePixel = 0
  2547. Frame223.Parent = Frame216
  2548. Frame223.Position = UDim2.new(0.4375, 0, 0.9375, 0)
  2549. Frame223.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2550. Frame223.BackgroundColor = BrickColor.new("Earth orange")
  2551. Frame223.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
  2552. Frame223.BorderSizePixel = 0
  2553. Frame224.Parent = Frame216
  2554. Frame224.Position = UDim2.new(0.5, 0, 0.4375, 0)
  2555. Frame224.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2556. Frame224.BackgroundColor = BrickColor.new("Institutional white")
  2557. Frame224.BackgroundColor3 = Color3.new(1, 1, 1)
  2558. Frame224.BorderSizePixel = 0
  2559. Frame225.Parent = Frame216
  2560. Frame225.Position = UDim2.new(0.4375, 0, 0.4375, 0)
  2561. Frame225.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2562. Frame225.BackgroundColor = BrickColor.new("Light yellow")
  2563. Frame225.BackgroundColor3 = Color3.new(1, 1, 0.592157)
  2564. Frame225.BorderSizePixel = 0
  2565. Frame226.Parent = Frame216
  2566. Frame226.Position = UDim2.new(0.5, 0, 0.375, 0)
  2567. Frame226.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2568. Frame226.BackgroundColor = BrickColor.new("Deep orange")
  2569. Frame226.BackgroundColor3 = Color3.new(1, 0.560784, 0)
  2570. Frame226.BorderSizePixel = 0
  2571. Frame227.Parent = Frame216
  2572. Frame227.Position = UDim2.new(0.4375, 0, 0.375, 0)
  2573. Frame227.Size = UDim2.new(0.0625, 0, 0.0625, 0)
  2574. Frame227.BackgroundColor = BrickColor.new("New Yeller")
  2575. Frame227.BackgroundColor3 = Color3.new(1, 0.847059, 0)
  2576. Frame227.BorderSizePixel = 0
  2577. PointLight228.Parent = Part149
  2578. PointLight228.Color = Color3.new(1, 0.937255, 0.780392)
  2579. PointLight228.Range = 42
  2580. PointLight228.Brightness = 0.60000002384186
  2581. PointLight228.Shadows = true
  2582. UnionOperation229.Name = "Chest"
  2583. UnionOperation229.Parent = Folder0
  2584. UnionOperation229.CFrame = CFrame.new(-5.96046448e-08, 1.36252606, -0.0937500596, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2585. UnionOperation229.Position = Vector3.new(-5.96046448e-08, 1.36252606, -0.0937500596)
  2586. UnionOperation229.Color = Color3.new(0.215686, 0.192157, 0.152941)
  2587. UnionOperation229.Size = Vector3.new(2.625, 2.62500024, 2.81250048)
  2588. UnionOperation229.Anchored = true
  2589. UnionOperation229.BrickColor = BrickColor.new("Earth green")
  2590. UnionOperation229.Material = Enum.Material.SmoothPlastic
  2591. UnionOperation229.brickColor = BrickColor.new("Earth green")
  2592. for i,v in pairs(mas:GetChildren()) do
  2593. v.Parent = script
  2594. pcall(function() v:MakeJoints() end)
  2595. end
  2596. mas:Destroy()
  2597. for i,v in pairs(cors) do
  2598. spawn(function()
  2599. pcall(v)
  2600. end)
  2601. end
  2602.  
  2603. local blocksize = 3
  2604. local viewdist = 4--3
  2605.  
  2606. --- Fi
  2607.  
  2608. local S_ReS = game.ReplicatedStorage
  2609. local S_RS = game:GetService("RunService")
  2610. local S_PS = game:GetService("PhysicsService")
  2611. local S_UIS = game:GetService("UserInputService")
  2612. local S_CAS = game:GetService("ContextActionService")
  2613. local S_H = game:GetService("HttpService")
  2614.  
  2615. local M_Ms = require(script:WaitForChild("MouseModule"))
  2616. local M_F = require(script:WaitForChild("FontModule"))
  2617. local M_BI = require(S_ReS:WaitForChild("AssetsMod"):WaitForChild("BlockInfo"))
  2618. local M_II = require(S_ReS.AssetsMod:WaitForChild("ItemInfo"))
  2619. local M_R = require(S_ReS.AssetsMod:WaitForChild("Recipes"))
  2620.  
  2621. local D_B = script:WaitForChild("Blocks")
  2622.  
  2623.  
  2624. local tex = require(S_ReS.AssetsMod:WaitForChild("Textures"))
  2625.  
  2626. function createBlock()
  2627. local block = Instance.new("Part")
  2628. block.Size = Vector3.new(blocksize,blocksize,blocksize)
  2629. block.Anchored = true
  2630. return block
  2631. end
  2632.  
  2633. for name,info in pairs(M_BI) do
  2634. if info.texture and (not info.customBlock) then
  2635. if type(info.texture) == "table" then
  2636. local bl = createBlock()
  2637. for face,v in pairs(info.texture) do
  2638. local d = Instance.new("Decal",bl)
  2639. d.Face = face
  2640. d.Texture = "rbxassetid://" .. tex[v]
  2641. end
  2642. if D_B:FindFirstChild(name) then
  2643. D_B[name]:Destroy()
  2644. end
  2645. bl.Name = name
  2646. bl.Parent = D_B
  2647. else
  2648. local bl = createBlock()
  2649. for i,face in pairs(Enum.NormalId:GetEnumItems()) do
  2650. local d = Instance.new("Decal",bl)
  2651. d.Face = face
  2652. --print(info.texture)
  2653. d.Texture = "rbxassetid://" .. tex[info.texture]
  2654. end
  2655. if D_B:FindFirstChild(name) then
  2656. D_B[name]:Destroy()
  2657. end
  2658. bl.Name = name
  2659. bl.Parent = D_B
  2660. end
  2661. end
  2662. end
  2663.  
  2664. local sounds = {
  2665.  
  2666. -- hurt
  2667. ["hurt1"] = 3362337129,
  2668. ["hurt2"] = 3362346832,
  2669. ["hurt3"] = 3362346832,
  2670.  
  2671. }
  2672.  
  2673. local materialsounds = { -- just footstep sounds
  2674. ["default"] = 507863857,
  2675. ["stone"] = 507863857,
  2676. ["wood"] = 507863857,--507863457,
  2677. ["grass"] = 507863105,
  2678. ["sand"] = 507863105,
  2679. ["leaves"] = 507863105,
  2680. ["dirt"] = 507864112,
  2681. }
  2682.  
  2683. local deb = { -- appears as particles when breaking a block
  2684. ["GrassBlock"] = "dirt",
  2685. ["Sand"] = "sand",
  2686. ["Dirt"] = "dirt",
  2687. ["Stone"] = "stone",
  2688. ["Bedrock"] = "bedrock",
  2689. ["OakPlanks"] = "planks",
  2690. ["OakLog"] = "planks",
  2691. ["Chest"] = "planks",
  2692. ["CraftingTable"] = "planks",
  2693. ["Glass"] = "glass",
  2694. ["Leaves"] = "leaves",
  2695. ["CoalBlock"] = "coalblock",
  2696. ["IronBlock"] = "ironblock",
  2697. ["DiamondBlock"] = "diamondblock",
  2698. ["Obsidian"] = "obsidian"
  2699. }
  2700.  
  2701. local bds = { -- block destroy sounds
  2702. ["GrassBlock"] = 379482039,
  2703. ["Sand"] = 379482039,
  2704. ["Dirt"] = 379482039,
  2705. ["Leaves"] = 379482039,
  2706. ["Stone"] = 507863457,
  2707. ["Bedrock"] = 507863457,
  2708. ["Glass"] = 2676503368
  2709. }
  2710.  
  2711. local blockinfo = {
  2712. ["Glass"] = {
  2713. closeValue = 0, -- determine if this block can hide a fully covered block (so we can save memory)
  2714. useDefaultBDS = true
  2715. },
  2716. ["Leaves"] = {
  2717. closeValue = 0
  2718. },
  2719. ["Torch"] = {
  2720. closeValue = 0
  2721. },
  2722. ["Water"] = {
  2723. closeValue = 0
  2724. },
  2725. ["Lava"] = {
  2726. closeValue = 0
  2727. },
  2728. ["Chest"] = {
  2729. closeValue = 0
  2730. }
  2731. }
  2732.  
  2733. local fMaxDepth = { -- fluid max depth
  2734. ["Water"] = 7,
  2735. ["Lava"] = 3,
  2736. }
  2737.  
  2738. --- Vari ables
  2739.  
  2740. local FX_P = script.Particle
  2741.  
  2742. local plr = game.Players.LocalPlayer
  2743. local char = plr.Character
  2744. if not char or not char.Parent then
  2745. char = plr.CharacterAdded:wait()
  2746. end
  2747.  
  2748. local sprinting = false
  2749.  
  2750. local p_gui = plr:WaitForChild("PlayerGui")
  2751. local p_bp = plr:WaitForChild("Backpack")
  2752.  
  2753. local gui_hud = p_gui:WaitForChild("HUDGui")
  2754.  
  2755. --local s_inv = char:WaitForChild("Inventory")
  2756. --while #s_inv:GetChildren() < 45 do
  2757. -- wait()
  2758. --end
  2759.  
  2760. local rmouse = plr:GetMouse()
  2761. local mouse = M_Ms.new()
  2762.  
  2763. local vblocks = Instance.new("Folder")
  2764. vblocks.Name = "Blocks"
  2765. vblocks.Parent = workspace
  2766. local vliquid = Instance.new("Folder")
  2767. vliquid.Name = "Fluid"
  2768. vliquid.Parent = workspace
  2769.  
  2770. local sbox = script.SelectionBox:Clone()
  2771. sbox.Parent = workspace
  2772.  
  2773. local L_CC = Instance.new("ColorCorrectionEffect")
  2774. L_CC.Brightness = 0
  2775. L_CC.Contrast = -.1
  2776. L_CC.Saturation = -.2
  2777. L_CC.Parent = game.Lighting
  2778.  
  2779. local lastBreaking = nil
  2780. local abreak = false
  2781. local breaking = nil
  2782. local breakTimer = 0
  2783. local breakDTimer = 0
  2784. local breakSTimer = 0
  2785.  
  2786. local entities = {}
  2787.  
  2788. local loadingChunks = {}
  2789. local world = {}
  2790. local flmt2 = {
  2791. __index = function(t,i)
  2792. local tb = {}
  2793. t[i] = tb
  2794. return tb
  2795. end
  2796. }
  2797. local flmt = {
  2798. __index = function(t,i)
  2799. local tb = setmetatable({},flmt2)
  2800. t[i] = tb
  2801. return tb
  2802. end
  2803. }
  2804. --local fastlink = setmetatable({},flmt) -- so i dont have to do this: c[x] and c[x][y] and c[x][y][z] and c[x][y][z][x1] and c[x][y][z][x1][x2]
  2805.  
  2806. local chCons = {}
  2807.  
  2808. local bob_attack = 0
  2809.  
  2810. --- Timers
  2811.  
  2812. local sufftimer = 0.5
  2813. local hurttimer = 10
  2814. local voidtimer = 0
  2815.  
  2816. ---
  2817.  
  2818. local grounded = false
  2819. local walkdist = 0
  2820.  
  2821. local inWater = false
  2822.  
  2823. ---
  2824.  
  2825. local selSlot = 0
  2826. local selSlotV = nil
  2827.  
  2828. ---
  2829.  
  2830. local tarPlayer = nil
  2831.  
  2832. local tarBlock = nil
  2833. local tarPos = Vector3.new()
  2834. local tarDir = Vector3.new()
  2835.  
  2836. local tarUsedBlock = nil
  2837.  
  2838. ---
  2839.  
  2840. local cHandle = {}
  2841.  
  2842. local hcf_block = CFrame.new(0, -1.12699997, -1, 0.707106829, 0, 0.707106829, 0, 1, -0, -0.707106829, 0, 0.707106829)
  2843. local hcf_tool = CFrame.new(0, -0.827000022, -1.15999997, 0, 0, -1.00000012, 0.707106769, 0.707106888, 0, 0.707106829, -0.707106769, 0)
  2844. local hcf_mat = CFrame.new(-0.466133118, -0.535684049, -0.845947266, 0.950247228, -0.245751619, -0.191406965, 0.308080107, 0.650695741, 0.694033086, -0.0460119694, -0.718471467, 0.694033027)
  2845.  
  2846. local hs_block = Vector3.new(1.3,1.3,1.3)
  2847. local hs_tool = Vector3.new(3,3,0.05)
  2848. local hs_mat = Vector3.new(1.3,1.3,0.05)
  2849.  
  2850. --- unused yet
  2851.  
  2852. local E_size = Vector3.new(0.6,1.8,0.6)
  2853.  
  2854. --local E_cPos = Vector3.new(0,10 * blocksize,0)
  2855. local E_cVel = Vector3.new()
  2856.  
  2857. ----- Math
  2858.  
  2859. function lerp(a,b,t)
  2860. return a + t * (b - a)
  2861. end
  2862.  
  2863. ----- Sound
  2864.  
  2865. function playSound(pos,id,sp,v)
  2866. local cx,cy = math.floor(pos.X/blocksize/16),math.floor(pos.Z/blocksize/16)
  2867. if getChunk(cx,cy) then
  2868. local att = Instance.new("Attachment")
  2869. att.Position = pos
  2870.  
  2871. local sound = Instance.new("Sound")
  2872. sound.SoundId = "rbxassetid://" .. id
  2873. sound.PlaybackSpeed = sp or (1 + ((math.random()-.5)*.3))
  2874. sound.Volume = v or .4
  2875. sound.Parent = att
  2876.  
  2877. att.Parent = workspace.Terrain
  2878. game.Debris:AddItem(att,10)
  2879. sound:Play()
  2880. sound.Stopped:Connect(function()
  2881. att:Destroy()
  2882. end)
  2883. return sound
  2884. end
  2885. end
  2886.  
  2887. S_ReS.GameRemotes.PlaySound.OnClientEvent:Connect(playSound)
  2888.  
  2889. ----- Misc Functions
  2890.  
  2891. function getGamemode()
  2892. local gamemode = char:FindFirstChild("Gamemode")
  2893. if not gamemode then
  2894. return 0
  2895. else
  2896. return gamemode.Value
  2897. end
  2898. end
  2899.  
  2900. function reqDamage(dmg,dtype)
  2901. if getGamemode() ~= 1 then
  2902. S_ReS.GameRemotes.RequestDamage:FireServer(dmg,dtype)
  2903. end
  2904. end
  2905.  
  2906. function getTimeFromSeconds(x)
  2907. local cv = x >= 60
  2908. local bv = x >= 60*60
  2909. local av = x >= 60*60*24
  2910.  
  2911. local a = 0
  2912. local b = 0
  2913. local c = 0
  2914. local d = 0
  2915. a = math.floor(x / 86400)
  2916. b = math.floor((x % 86400) / 3600)
  2917. c = math.floor((x % 3600) / 60)
  2918. d = math.floor(x % 60)
  2919. local e = tostring(a)
  2920. local f = tostring(b)
  2921. local g = tostring(c)
  2922. local h = tostring(d)
  2923. if f:len() == 1 then
  2924. f = "0" .. f
  2925. end
  2926. if g:len() == 1 then
  2927. g = "0" .. g
  2928. end
  2929. if h:len() == 1 then
  2930. h = "0" .. h
  2931. end
  2932. if av then
  2933. return e .. ":" .. f .. ":" .. g .. ":" .. h
  2934. elseif bv then
  2935. return tostring(b) .. ":" .. g .. ":" .. h
  2936. elseif cv then
  2937. return tostring(c) .. ":" .. h
  2938. else
  2939. return tostring(d)
  2940. end
  2941. end
  2942.  
  2943. function getBlockModel(name)
  2944. local block = D_B[name]
  2945. block = block and block:Clone()
  2946. return block
  2947. end
  2948.  
  2949. function getSurfacePosition2(a,b)
  2950. local rp = b - a
  2951. if math.abs(rp.X) > math.abs(rp.Z) then
  2952. if rp.X > 0 then
  2953. rp = Vector3.new(1,0,0)
  2954. else
  2955. rp = Vector3.new(-1,0,0)
  2956. end
  2957. return rp
  2958. elseif math.abs(rp.Z) > math.abs(rp.X) then
  2959. if rp.Z > 0 then
  2960. rp = Vector3.new(0,0,1)
  2961. else
  2962. rp = Vector3.new(0,0,-1)
  2963. end
  2964. return rp
  2965. end
  2966. return rp
  2967. end
  2968.  
  2969. ----- Inventory
  2970.  
  2971. local curIT = "default"
  2972.  
  2973. local invOpen = false
  2974.  
  2975. local g_slot = script.Slot:Clone()
  2976. local g_slotna = script.SlotNA:Clone()
  2977. local g_slotb = script.SlotB:Clone()
  2978.  
  2979. local slotUFs = {}
  2980. local slotUFs2 = {}
  2981.  
  2982. local crafting = {}
  2983.  
  2984. local craft_hand_vis = {}
  2985. local craft_hand_link = { [80] = 1, [81] = 2, [82] = 4, [83] = 5 }
  2986. local craft_table_link = { [80] = 1, [81] = 2, [82] = 3, [83] = 4, [84] = 5, [85] = 6, [86] = 7, [87] = 8, [88] = 9 }
  2987. --local craft_hand_link_r = {}
  2988. --for i,v in pairs(craft_hand_link) do
  2989. -- craft_hand_link_r[v] = i
  2990. --end
  2991.  
  2992. local it_craftHand = {
  2993. [80] = UDim2.new(0, 168,0, 44),
  2994. [81] = UDim2.new(0, 204,0, 44),
  2995. [82] = UDim2.new(0, 168,0, 80),
  2996. [83] = UDim2.new(0, 204,0, 80),
  2997. }
  2998. local it_craftTab = {
  2999. [80] = UDim2.new(0, 52,0, 26),
  3000. [81] = UDim2.new(0, 88,0, 26),
  3001. [82] = UDim2.new(0, 124,0, 26),
  3002. [83] = UDim2.new(0, 52,0, 62),
  3003. [84] = UDim2.new(0, 88,0, 62),
  3004. [85] = UDim2.new(0, 124,0, 62),
  3005. [86] = UDim2.new(0, 52,0, 98),
  3006. [87] = UDim2.new(0, 88,0, 98),
  3007. [88] = UDim2.new(0, 124,0, 98),
  3008. }
  3009. local extS = {}
  3010.  
  3011. function switchIT(it)
  3012. if it == "CraftingTable" then
  3013. curIT = "crafting2"
  3014. p_gui.HUDGui.Inventory.Crafting2.Visible = true
  3015. p_gui.HUDGui.Inventory.Crafting.Visible = false
  3016. p_gui.HUDGui.Inventory.Mirror.Visible = false
  3017. p_gui.HUDGui.Inventory.Chest.Visible = false
  3018. p_gui.HUDGui.Inventory.Furnace.Visible = false
  3019.  
  3020. p_gui.HUDGui.Inventory.ResultSlot.Position = UDim2.new(0,240,0,62)
  3021. p_gui.HUDGui.Inventory.ResultSlot.Visible = true
  3022. for i=100,103 do
  3023. local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
  3024. s.Visible = false
  3025. end
  3026. for i=80,88 do
  3027. local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
  3028. --if i>=84 then
  3029. s.Visible = true
  3030. --end
  3031. s.Position = it_craftTab[i]
  3032. end
  3033. elseif it == "Chest" then
  3034. curIT = "chest"
  3035. p_gui.HUDGui.Inventory.Crafting2.Visible = false
  3036. p_gui.HUDGui.Inventory.Crafting.Visible = false
  3037. p_gui.HUDGui.Inventory.Mirror.Visible = false
  3038. p_gui.HUDGui.Inventory.Chest.Visible = true
  3039. p_gui.HUDGui.Inventory.Furnace.Visible = false
  3040.  
  3041. p_gui.HUDGui.Inventory.ResultSlot.Visible = false
  3042. for i=100,103 do
  3043. local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
  3044. s.Visible = false
  3045. end
  3046. for i=80,88 do
  3047. local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
  3048. s.Visible = false
  3049. end
  3050. updateExternals()
  3051. elseif it == "Furnace" then
  3052. curIT = "furnace"
  3053. p_gui.HUDGui.Inventory.Crafting2.Visible = false
  3054. p_gui.HUDGui.Inventory.Crafting.Visible = false
  3055. p_gui.HUDGui.Inventory.Mirror.Visible = false
  3056. p_gui.HUDGui.Inventory.Chest.Visible = false
  3057. p_gui.HUDGui.Inventory.Furnace.Visible = true
  3058.  
  3059. p_gui.HUDGui.Inventory.ResultSlot.Visible = false
  3060. for i=100,103 do
  3061. local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
  3062. s.Visible = false
  3063. end
  3064. for i=80,88 do
  3065. local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
  3066. s.Visible = false
  3067. end
  3068. updateExternals()
  3069. else
  3070. curIT = "default"
  3071. p_gui.HUDGui.Inventory.Crafting.Visible = true
  3072. p_gui.HUDGui.Inventory.Mirror.Visible = true
  3073. p_gui.HUDGui.Inventory.Crafting2.Visible = false
  3074. p_gui.HUDGui.Inventory.Chest.Visible = false
  3075. p_gui.HUDGui.Inventory.Furnace.Visible = false
  3076.  
  3077. p_gui.HUDGui.Inventory.ResultSlot.Position = UDim2.new(0,280,0,64)
  3078. p_gui.HUDGui.Inventory.ResultSlot.Visible = true
  3079. for i=100,103 do
  3080. local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
  3081. s.Visible = true
  3082. end
  3083. for i=80,88 do
  3084. local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
  3085. if i>=84 then
  3086. s.Visible = false
  3087. else
  3088. s.Visible = true
  3089. s.Position = it_craftHand[i]
  3090. end
  3091. end
  3092. end
  3093. end
  3094.  
  3095. function updateExternals()
  3096. if invOpen then
  3097. local bl,ch = getBlock(tarUsedBlock.X,tarUsedBlock.Y,tarUsedBlock.Z)
  3098. if bl and bl.name then
  3099. if bl.name == "CraftingTable" then
  3100. -- do something- oh wait
  3101. elseif bl.name == "Furnace" then
  3102.  
  3103. elseif bl.name == "Chest" then
  3104. if bl.storage then
  3105. for i=0,26 do
  3106. extS[i] = bl.storage[i]
  3107. end
  3108. end
  3109. updateExtVis()
  3110. else
  3111. tarUsedBlock = nil
  3112. openInv()
  3113. end
  3114. else
  3115. tarUsedBlock = nil
  3116. openInv()
  3117. end
  3118. end
  3119. end
  3120.  
  3121. function updateExtVis()
  3122.  
  3123. end
  3124.  
  3125. function updateAllSlots()
  3126. for _,v in pairs(slotUFs2) do
  3127. v()
  3128. end
  3129. end
  3130. function transItem(t1,t2,stack,count)
  3131. --local t1 = S_H:JSONDecode(v1.Value)
  3132. -- local t2 = S_H:JSONDecode(v2.Value)
  3133.  
  3134. if stack and t1.name and (t1.count > 0) and t2.name and (t2.count > 0) and (t1.name == t2.name) then
  3135. local item = M_II[t1.name]
  3136. local stack = item and item.maxstack or 64
  3137. local give = count and math.min(count,t1.count) or t1.count
  3138. local fill = (stack - t2.count)
  3139. local act = math.min(fill,give)
  3140.  
  3141. t1.count = t1.count - act
  3142. t2.count = t2.count + act
  3143.  
  3144. return S_H:JSONEncode(t1),S_H:JSONEncode(t2)
  3145. elseif stack and t1.name and (t1.count > 0) and (t2.count <= 0) then
  3146. if t1.count == 1 then
  3147. return S_H:JSONEncode(t2),S_H:JSONEncode(t1)
  3148. else
  3149. local t3 = {}
  3150. for i,v in pairs(t1) do
  3151. t3[i] = v
  3152. end
  3153.  
  3154. local item = M_II[t1.name]
  3155. local stack = item and item.maxstack or 64
  3156. local give = count and math.min(count,t1.count) or t1.count
  3157. local fill = (stack - t2.count)
  3158. local act = math.min(fill,give)
  3159.  
  3160. t1.count = t1.count - act
  3161. t3.count = act
  3162.  
  3163. return S_H:JSONEncode(t1),S_H:JSONEncode(t3)
  3164. end
  3165. else
  3166. return S_H:JSONEncode(t2),S_H:JSONEncode(t1)
  3167. end
  3168. end
  3169. function moveItem(s1,s2,stack,count,e1,e2)
  3170. local inv = s_inv
  3171. local v1 = (not e1) and inv:FindFirstChild("Slot" .. s1)
  3172. local v2 = (not e2) and inv:FindFirstChild("Slot" .. s2)
  3173. --if v1 and v2 then
  3174. --print("Ye")
  3175. local t1 = (e1 and extS[s1]) or (v1 and S_H:JSONDecode(v1.Value))
  3176. local t2 = (e2 and extS[s2]) or (v2 and S_H:JSONDecode(v2.Value))
  3177.  
  3178. t1,t2 = transItem(t1,t2,stack,count)
  3179.  
  3180. if e1 then
  3181. extS[s1] = S_H:JSONEncode(t1)
  3182. else
  3183. v1.Value = S_H:JSONEncode(t1)
  3184. end
  3185. if e2 then
  3186. extS[s2] = S_H:JSONEncode(t2)
  3187. else
  3188. v2.Value = S_H:JSONEncode(t2)
  3189. end
  3190.  
  3191. if e1 or e2 then updateExtVis() end
  3192. --end
  3193. game.ReplicatedStorage.GameRemotes.MoveItem:InvokeServer(s1,s2,stack,count,e1,e2,(e1 or e2) and (tarUsedBlock))
  3194. updateExternals()
  3195. slotUFs[s2]()
  3196. end
  3197.  
  3198. local resultSlot = nil
  3199. local craftResult = nil
  3200.  
  3201. function updateResult()
  3202. local slot = resultSlot
  3203. if not slot then
  3204.  
  3205. resultSlot = g_slot:Clone()
  3206. slot = resultSlot
  3207. local sl = resultSlot
  3208. sl.BackgroundColor3 = Color3.fromHSV(0,0,139/255)
  3209. sl.Position = UDim2.new(0,2,0,2)
  3210. M_F.linkLabel(sl.Count)
  3211. M_F.linkLabel(sl.Shadow)
  3212.  
  3213. --cslot.ZIndex = 5
  3214. --sl.ZIndex = 5
  3215. sl.MouseButton1Down:Connect(function()
  3216. if craftResult and craftResult[1] then
  3217. game.ReplicatedStorage.GameRemotes.CraftItems:InvokeServer((curIT == "crafting2") and tarUsedBlock)
  3218. end
  3219. end)
  3220.  
  3221. sl.Parent = p_gui.HUDGui.Inventory.ResultSlot
  3222. end
  3223. local item = craftResult and craftResult[1]
  3224.  
  3225. local count = craftResult and craftResult[2] or 0
  3226.  
  3227. slot.Display:ClearAllChildren()
  3228. slot.Count.Text = count
  3229. slot.Shadow.Text = count
  3230. slot.Count.Visible = count > 1
  3231. slot.Shadow.Visible = count > 1
  3232. local item = item and M_II[item]
  3233.  
  3234. if item then
  3235. if item.block then
  3236. local sb = g_slotb:Clone()
  3237. local bl = getBlockModel(item.block)
  3238. bl.CFrame = CFrame.new() * CFrame.Angles(0,math.pi,0)
  3239. for _,v in pairs(bl:GetChildren()) do
  3240. if v:IsA("Decal") then
  3241. if v.Face == Enum.NormalId.Front then
  3242. v.Color3 = Color3.fromHSV(0,0,190/255)
  3243. elseif v.Face == Enum.NormalId.Left then
  3244. v.Color3 = Color3.fromHSV(0,0,140/255)
  3245. end
  3246. end
  3247. end
  3248. bl.Parent = sb
  3249.  
  3250. sb.Parent = slot.Display
  3251. else
  3252. local tex = (script.ItemTextures:FindFirstChild(item.texture or "missing") or script.ItemTextures.missing):Clone()
  3253. tex.Parent = slot.Display
  3254. end
  3255. --else
  3256. --local tex = script.ItemTextures.missing:Clone()
  3257. --tex.Parent = slot.Display
  3258. end
  3259.  
  3260. end
  3261.  
  3262. function link(slot,val,id,uf)
  3263. local lastname = nil
  3264. local lastcount = 0
  3265. local function update(new)
  3266. local tab = S_H:JSONDecode(new or val.Value)
  3267. local count = tab.count
  3268. if (count ~= lastcount) or (tab.name ~= lastname) then
  3269. lastname = tab.name
  3270. lastcount = count
  3271. slot.Display:ClearAllChildren()
  3272. slot.Count.Text = count
  3273. slot.Shadow.Text = count
  3274. slot.Count.Visible = count > 1
  3275. slot.Shadow.Visible = count > 1
  3276. --end
  3277. if count and (count > 0) and tab.name then
  3278. local item = M_II[tab.name]
  3279.  
  3280. if item then
  3281. if item.block then
  3282. local sb = g_slotb:Clone()
  3283. local bl = getBlockModel(item.block)
  3284. bl.CFrame = CFrame.new() * CFrame.Angles(0,math.pi*-.5,0)
  3285. for _,v in pairs(bl:GetChildren()) do
  3286. if v:IsA("Decal") then
  3287. if v.Face == Enum.NormalId.Right then
  3288. v.Color3 = Color3.fromHSV(0,0,190/255)
  3289. elseif v.Face == Enum.NormalId.Front then
  3290. v.Color3 = Color3.fromHSV(0,0,140/255)
  3291. end
  3292. end
  3293. end
  3294. bl.Parent = sb
  3295.  
  3296. sb.Parent = slot.Display
  3297. else
  3298. local tex = (script.ItemTextures:FindFirstChild(item.texture or "missing") or script.ItemTextures.missing):Clone()
  3299. tex.Parent = slot.Display
  3300. end
  3301. else
  3302. local tex = script.ItemTextures.missing:Clone()
  3303. tex.Parent = slot.Display
  3304. end
  3305. end
  3306.  
  3307. if (id >= 80) and (id <= 88) then
  3308. local existence = false
  3309. local tab = {
  3310.  
  3311. }
  3312. local linker = (curIT == "crafting2") and craft_table_link or craft_hand_link
  3313. if (curIT == "crafting2") then
  3314. for i=80,88 do
  3315. local it = S_H:JSONDecode(s_inv["Slot"..i].Value)
  3316. tab[craft_table_link[i]] = (it.count > 0) and it.name
  3317. if (it.count > 0) and it.name then existence = true end
  3318. end
  3319. else
  3320. for i=80,83 do
  3321. local it = S_H:JSONDecode(s_inv["Slot"..i].Value)
  3322. tab[craft_hand_link[i]] = (it.count > 0) and it.name
  3323. if (it.count > 0) and it.name then existence = true end
  3324. end
  3325. end
  3326. if existence then
  3327.  
  3328. while not (tab[1] or tab[2] or tab[3]) do
  3329. tab[1] = tab[4]; tab[4] = tab[7]; tab[7] = nil
  3330. tab[2] = tab[5]; tab[5] = tab[8]; tab[8] = nil
  3331. tab[3] = tab[6]; tab[6] = tab[9]; tab[9] = nil
  3332. end
  3333. while not (tab[1] or tab[4] or tab[7]) do
  3334. tab[1] = tab[2]; tab[2] = tab[3]; tab[3] = nil
  3335. tab[4] = tab[5]; tab[5] = tab[6]; tab[6] = nil
  3336. tab[7] = tab[8]; tab[8] = tab[9]; tab[9] = nil
  3337. end
  3338.  
  3339. local result = nil
  3340. for i,v in pairs(M_R[1]) do
  3341. local correct = true
  3342. for a=1,9 do
  3343. local actual = tab[a]
  3344. if not actual then
  3345. actual = nil -- Lua
  3346. end
  3347. if actual ~= v[a] then
  3348. correct = false
  3349. end
  3350. end
  3351. if correct then
  3352. result = {i,v[10]}
  3353. break
  3354. end
  3355. end
  3356.  
  3357. craftResult = result
  3358.  
  3359. updateResult()
  3360. else
  3361. craftResult = nil
  3362.  
  3363. updateResult()
  3364. end
  3365. end
  3366. end
  3367. end
  3368.  
  3369. table.insert(chCons,val.Changed:Connect(update))
  3370. if uf then slotUFs[id] = update end
  3371. table.insert(slotUFs2,update)
  3372. update(val.Value)
  3373. end
  3374.  
  3375. function loadInventory()
  3376.  
  3377. p_gui:WaitForChild("HUDGui"):WaitForChild("Hotbar")
  3378. p_gui.HUDGui:WaitForChild("Inventory"):WaitForChild("Slots")
  3379. p_gui.HUDGui.Inventory:WaitForChild("Mirror")
  3380. wait()
  3381.  
  3382. slotUFs = {}
  3383. slotUFs2 = {}
  3384. resultSlot = nil
  3385.  
  3386. --
  3387.  
  3388. local moriginslot = nil
  3389.  
  3390. for i,v in pairs(s_inv:GetChildren()) do
  3391. local i = tonumber(v.Name:sub(5))
  3392. if (i<100) and (i>=-1) then
  3393. if (i>=0) and (i<=8) then
  3394. local sl = g_slot:Clone()
  3395. sl.Position = UDim2.new(0,6 + 40*i,0,6)
  3396. M_F.linkLabel(sl.Count)
  3397. M_F.linkLabel(sl.Shadow)
  3398. sl.MouseButton1Click:Connect(function()
  3399. setSelSlot(i)
  3400. end)
  3401. sl.Parent = p_gui.HUDGui.Hotbar
  3402. link(sl,v,i)
  3403. end
  3404. local cslot = p_gui.HUDGui.Inventory.Slots:FindFirstChild("Slot" .. i)
  3405. if cslot then
  3406. local sl = (i==-1) and g_slotna:Clone() or g_slot:Clone()
  3407. sl.BackgroundColor3 = Color3.fromHSV(0,0,139/255)
  3408. sl.Position = UDim2.new(0,2,0,2)
  3409. M_F.linkLabel(sl.Count)
  3410. M_F.linkLabel(sl.Shadow)
  3411.  
  3412. if i==-1 then
  3413. --sl.Selectable = false
  3414. --sl.Active = false
  3415. table.insert(chCons,S_RS.RenderStepped:Connect(function()
  3416. cslot.Position = UDim2.new(0,rmouse.X - cslot.Parent.AbsolutePosition.X - 18,0,rmouse.Y - cslot.Parent.AbsolutePosition.Y - 18)
  3417. end))
  3418. else
  3419. --cslot.ZIndex = 5
  3420. --sl.ZIndex = 5
  3421. local function swap()
  3422. if not invOpen then return end
  3423. local v2 = s_inv["Slot-1"]
  3424. local tab = S_H:JSONDecode(v2.Value) -- Holding slot item
  3425. local tab2 = S_H:JSONDecode(v.Value) -- Selecting slot item
  3426.  
  3427. local exist1 = tab and tab.name and (tab.count > 0) -- if the cursor is holding something
  3428. local exist2 = tab2 and tab2.name and (tab2.count > 0) -- if the selected slot is holding something
  3429.  
  3430. -- local count = tab and tab.count
  3431. -- if count then
  3432. -- for _,v in pairs(crafting) do
  3433. -- if v.originslot and (v.originslot == i) then
  3434. -- count = count - v.count
  3435. -- end
  3436. -- end
  3437. -- end
  3438.  
  3439. if exist1 or exist2 then
  3440. if not exist1 then
  3441. moriginslot = i
  3442. moveItem(i,-1)
  3443. else
  3444. if exist2 then
  3445. moriginslot = i
  3446. else
  3447. moriginslot = nil
  3448. end
  3449. moveItem(-1,i,true)
  3450. end
  3451. end
  3452. --if exist1 and exist2 then
  3453. -- v.Value = tab
  3454. -- v2.Value = tab2
  3455. --
  3456. --end
  3457. end
  3458. local function putDownSingle()
  3459. if not invOpen then return end
  3460. local v2 = s_inv["Slot-1"]
  3461. local tab = S_H:JSONDecode(v2.Value) -- Holding slot item
  3462. local tab2 = S_H:JSONDecode(v.Value) -- Selecting slot item
  3463.  
  3464. local exist1 = tab and tab.name and (tab.count > 0) -- if the cursor is holding something
  3465. local exist2 = tab2 and tab2.name and (tab2.count > 0) -- if the selected slot is holding something
  3466. if exist1 then
  3467. moriginslot = i
  3468. moveItem(-1,i,true,1)
  3469. end
  3470. --if exist1 and exist2 then
  3471. -- v.Value = tab
  3472. -- v2.Value = tab2
  3473. --
  3474. --end
  3475. end
  3476. sl.MouseButton1Down:Connect(swap)
  3477. sl.MouseButton2Down:Connect(putDownSingle)
  3478. sl.MouseEnter:Connect(function()
  3479. sl.Highlight.BackgroundTransparency = 0.75
  3480. if invOpen and S_UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) then
  3481. putDownSingle()
  3482. end
  3483. end)
  3484. sl.MouseLeave:Connect(function()
  3485. sl.Highlight.BackgroundTransparency = 1
  3486. end)
  3487. end
  3488.  
  3489. sl.Parent = cslot
  3490. link(sl,v,i,true)
  3491. end
  3492. end
  3493. end
  3494.  
  3495. -- Crafting
  3496.  
  3497. -- Mirror
  3498. char.Archivable =true
  3499. local charc = char:Clone()
  3500. for _,v in pairs(charc:GetChildren()) do
  3501. if v:IsA("Script") or v:IsA("Folder") then
  3502. v:Destroy()
  3503. end
  3504. end
  3505. char.Archivable =false
  3506.  
  3507. table.insert(chCons,char.ChildAdded:Connect(function(v)
  3508. if not (v:IsA("Script") or v:IsA("Folder")) then
  3509. v:Clone().Parent = charc
  3510. end
  3511. end))
  3512.  
  3513. charc.Parent = p_gui.HUDGui.Inventory.Mirror.VPFrame
  3514. charc.PrimaryPart = charc.HumanoidRootPart
  3515. charc:SetPrimaryPartCFrame(CFrame.new(0,.25,0))
  3516. charc.Name = ""
  3517. charc.Humanoid.BreakJointsOnDeath = false
  3518. charc.Humanoid.NameDisplayDistance = 0
  3519. charc.HumanoidRootPart.Anchored = true
  3520.  
  3521. table.insert(chCons,S_RS.RenderStepped:Connect(function()
  3522. if invOpen and p_gui.HUDGui.Inventory.Mirror.Visible then
  3523. local apos = p_gui.HUDGui.Inventory.Mirror.VPFrame.AbsolutePosition + (p_gui.HUDGui.Inventory.Mirror.VPFrame.AbsoluteSize/2)
  3524. local offset = Vector2.new(rmouse.X - apos.X,rmouse.Y - apos.Y)
  3525. --charc.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(0,1.7,0),Vector3.new(offset.X,0,-50 + offset.Y))
  3526. charc:SetPrimaryPartCFrame(CFrame.new(Vector3.new(0,.25,0),Vector3.new(-math.tanh(offset.X/65)*45,-offset.Y/35,-50)))
  3527. charc.Head.CFrame = charc.HumanoidRootPart.CFrame * CFrame.new(0,1,0) * CFrame.Angles(-math.tanh(offset.Y/135)/3,0,0) * CFrame.new(0,.5,0)
  3528. end
  3529. end))
  3530. end
  3531.  
  3532. function updateSelSlot()
  3533. if s_inv then
  3534. p_gui.HUDGui.Hotbar.Selector.Position = UDim2.new(0,-2 + (selSlot * 40),0,-2)
  3535. selSlotV = s_inv["Slot"..selSlot]
  3536. game.ReplicatedStorage.GameRemotes.ChangeSlot:InvokeServer(selSlot)
  3537. end
  3538. end
  3539. function changeSelSlot(inc)
  3540. if s_inv then
  3541. selSlot = (selSlot + inc)%9
  3542. updateSelSlot()
  3543. end
  3544. end
  3545. function setSelSlot(i)
  3546. selSlot = i
  3547. updateSelSlot()
  3548. end
  3549.  
  3550. function openInv(it)
  3551. invOpen = not invOpen
  3552. if invOpen then
  3553. switchIT(it)
  3554. end
  3555. updateAllSlots()
  3556. p_gui.HUDGui.Overshadow.Visible = invOpen
  3557. p_gui.HUDGui.Inventory.Visible = invOpen
  3558. if not invOpen then
  3559. local function rep(i)
  3560. local tab = S_H:JSONDecode(s_inv["Slot"..i].Value)
  3561. if tab and (tab.count > 0) then
  3562. game.ReplicatedStorage.GameRemotes.SortItem:InvokeServer(i)
  3563. end
  3564. end
  3565. rep(-1)
  3566. for i=80,88 do
  3567. rep(i)
  3568. end
  3569. end
  3570. end
  3571.  
  3572. function toggleInv(aName,state)
  3573. if (not state) or (state and (state == Enum.UserInputState.Begin)) then
  3574. openInv()
  3575. end
  3576. end
  3577.  
  3578. ----- Health
  3579.  
  3580. local g_heart = script.Heart:Clone()
  3581.  
  3582. function linkHealth(human)
  3583. local shaking = false
  3584.  
  3585. local ping_dmg = 0
  3586. local ping_heal = 0
  3587.  
  3588. local h_wol = false
  3589.  
  3590. local lastHealth = human.Health
  3591. local lastVHealth = math.ceil(lastHealth/5)
  3592.  
  3593. p_gui:WaitForChild("HUDGui"):WaitForChild("Hotbar"):WaitForChild("HealthBar")
  3594. wait()
  3595.  
  3596. local htab = {}
  3597. for i=1,10 do
  3598. local heart = g_heart:Clone()
  3599. heart.Position = UDim2.new(0,16*(i-1),0,0)
  3600.  
  3601. heart.Parent = p_gui.HUDGui.Hotbar.HealthBar
  3602. htab[i] = heart
  3603. end
  3604. local function update(new)
  3605. local change = new - lastHealth
  3606.  
  3607. lastHealth = new
  3608.  
  3609. local changeL = math.ceil(new/5) - lastVHealth
  3610. lastVHealth = math.ceil(lastHealth/5)
  3611.  
  3612. if (change < 0) then
  3613. hurttimer = 0
  3614. ping_dmg = 0
  3615. elseif (changeL > 0) then
  3616. ping_heal = 0
  3617. end
  3618.  
  3619. for i,v in pairs(htab) do
  3620. local left = lastVHealth >= (i*2 - 1)
  3621. local right = lastVHealth >= (i*2)
  3622. -- left half
  3623. v.ImageColor3 = right and Color3.new(1, 19/255, 19/255) or Color3.fromHSV(0,0,40/255)
  3624. v.Half.Visible = left
  3625. end
  3626. end
  3627.  
  3628. human.HealthChanged:Connect(update)
  3629. update(human.Health)
  3630.  
  3631. pcall(S_RS.UnbindFromRenderStep,S_RS,"health")
  3632.  
  3633. S_RS:BindToRenderStep("health",Enum.RenderPriority.Character.Value + 1,function(dt)
  3634. if p_gui:FindFirstChild("HUDGui") then
  3635. if (human.Health ~= math.huge) and (getGamemode() ~= 1) then
  3636.  
  3637. p_gui.HUDGui.Hotbar.HealthBar.Visible = true
  3638.  
  3639. if lastVHealth <= 4 then
  3640. shaking = true
  3641. if shaking then
  3642. for i,v in pairs(htab) do
  3643. if math.random(1,3) == 2 then
  3644. v.Position = UDim2.new(0,16*(i-1),0,math.random(0,1)*2)
  3645. end
  3646. end
  3647. else
  3648. for i,v in pairs(htab) do
  3649. v.Position = UDim2.new(0,16*(i-1),0,math.random(0,1)*2)
  3650. end
  3651. end
  3652. elseif (lastVHealth > 4) and shaking then
  3653. shaking = false
  3654. for i,v in pairs(htab) do
  3655. v.Position = UDim2.new(0,16*(i-1),0,0)
  3656. end
  3657. end
  3658.  
  3659. if ping_dmg < ping_heal then
  3660. if ((ping_dmg) <= .9) and ((ping_dmg%0.3) < .15) and (not h_wol) then
  3661. h_wol = true
  3662. for _,v in pairs(p_gui.HUDGui.Hotbar.HealthBar:GetChildren()) do
  3663. v.Outline.ImageColor3 = Color3.new(1,1,1)
  3664. end
  3665. elseif (((ping_dmg) > .9) or ((ping_dmg%0.3) > .15)) and h_wol then
  3666. h_wol = false
  3667. for _,v in pairs(p_gui.HUDGui.Hotbar.HealthBar:GetChildren()) do
  3668. v.Outline.ImageColor3 = Color3.new(0,0,0)
  3669. end
  3670. end
  3671. else
  3672. if ((ping_heal + 0.08) <= .6) and (((ping_heal + 0.08)%0.3) < .15) and (not h_wol) then
  3673. h_wol = true
  3674. for _,v in pairs(p_gui.HUDGui.Hotbar.HealthBar:GetChildren()) do
  3675. v.Outline.ImageColor3 = Color3.new(1,1,1)
  3676. end
  3677. elseif (((ping_heal + 0.08) > .6) or (((ping_heal + 0.08)%0.3) > .15)) and h_wol then
  3678. h_wol = false
  3679. for _,v in pairs(p_gui.HUDGui.Hotbar.HealthBar:GetChildren()) do
  3680. v.Outline.ImageColor3 = Color3.new(0,0,0)
  3681. end
  3682. end
  3683. end
  3684.  
  3685. else
  3686.  
  3687. p_gui.HUDGui.Hotbar.HealthBar.Visible = false
  3688.  
  3689. end
  3690. end
  3691. ping_dmg = math.clamp(ping_dmg + dt,0,10)
  3692. ping_heal = math.clamp(ping_heal + dt,0,10)
  3693. end)
  3694. end
  3695.  
  3696. ----- Entities
  3697.  
  3698. function updateEntities(dt)
  3699. for i,v in pairs(entities) do
  3700. if not (i.Parent == workspace.Entities) then
  3701. if v.part then
  3702. v.part:Destroy()
  3703. end
  3704. entities[i] = nil
  3705. end
  3706. end
  3707. for _,v in pairs(workspace.Entities:GetChildren()) do
  3708. local ent = entities[v]
  3709. local dat = S_H:JSONDecode(v.Value)
  3710. if not ent then
  3711. ent = {
  3712. spawned = time(),
  3713. lastSPos = Vector3.new(unpack(dat.pos)),
  3714. pos = Vector3.new(unpack(dat.pos)),
  3715. vel = Vector3.new(unpack(dat.pos)),
  3716. oSize = Vector3.new(),
  3717. data = dat
  3718. }
  3719. entities[v] = ent
  3720.  
  3721. if v.Name == "item" then
  3722. local name = dat.name
  3723. local item = M_II[name]
  3724. local part = nil
  3725. if item then
  3726. if item.block then
  3727. local block = getBlockModel(item.block)
  3728. if block then
  3729. block = block:Clone()
  3730. block.Size = Vector3.new(.61,.61,.61)
  3731. ent.oSize = block.Size
  3732. block.CanCollide = false
  3733. block.Anchored = true
  3734. part = block
  3735. end
  3736. end
  3737. if not part then
  3738. local tex = (script.ItemTextures:FindFirstChild(item.texture or "missing") or script.ItemTextures.missing):Clone()
  3739. local sgp = Instance.new("Part")
  3740. sgp.Size = Vector3.new(1.2,1.2,0.05)
  3741. ent.oSize = sgp.Size
  3742. sgp.Transparency = 1
  3743. sgp.CanCollide = false
  3744. sgp.Anchored = true
  3745.  
  3746. local sgui = Instance.new("SurfaceGui")
  3747. sgui.CanvasSize = Vector2.new(32,32)
  3748. sgui.Face = Enum.NormalId.Front
  3749. sgui.LightInfluence = 1
  3750. tex:Clone().Parent = sgui
  3751. local sgui2 = Instance.new("SurfaceGui")
  3752. sgui2.CanvasSize = Vector2.new(32,32)
  3753. sgui2.Face = Enum.NormalId.Back
  3754. sgui2.LightInfluence = 1
  3755. tex.Parent = sgui2
  3756.  
  3757. sgui.Parent = sgp
  3758. sgui2.Parent = sgp
  3759.  
  3760. part = sgp
  3761. end
  3762. end
  3763. if part then
  3764. part.Parent = workspace
  3765. ent.part = part
  3766. end
  3767. end
  3768. end
  3769. if v.Name == "item" then
  3770. if dat.fadeTo then
  3771. if not ent.fadeTo then
  3772. ent.fadeTo = dt
  3773. else
  3774. ent.fadeTo = ent.fadeTo + dt
  3775. end
  3776. end
  3777. if ent.part then
  3778. local spos = Vector3.new(unpack(dat.pos))
  3779. if spos ~= ent.lastSPos then
  3780. ent.lastSPos = spos
  3781. ent.pos = spos
  3782. ent.vel = Vector3.new(unpack(dat.vel))
  3783. end
  3784. local pos = ent.pos--Vector3.new(unpack(dat.pos))
  3785. local dist = (pos - workspace.CurrentCamera.CFrame.Position).Magnitude
  3786. if dist < (viewdist*16) then
  3787. if ent.fadeTo then
  3788. pos = pos:Lerp(Vector3.new(unpack(dat.fadeTo)),math.min(1,ent.fadeTo*10))
  3789. if (ent.fadeTo*10) > 1 then
  3790. ent.part.Parent = nil
  3791. else
  3792. ent.part.Size = ent.oSize * (1-math.min(1,ent.fadeTo*10))
  3793. ent.part.Parent = workspace
  3794. end
  3795. else
  3796. ent.part.Parent = workspace
  3797. end
  3798.  
  3799. ent.part.CFrame = CFrame.new(pos) * CFrame.new(0,math.cos((time() - ent.spawned)*2.4)/3,0) * CFrame.Angles(0,((time() - ent.spawned)/1)%(math.pi*2),0)
  3800. else
  3801. ent.part.Parent = nil
  3802. end
  3803. local vel = ent.vel
  3804. if (not ent.fadeTo) and (dist < (blocksize*8)) then
  3805. pos = pos + (vel*dt)
  3806. vel = vel + Vector3.new(0,-16*blocksize * dt,0)
  3807. local pos2 = Vector3.new(pos.X,pos.Y - 0.82,pos.Z)
  3808. local rx2,ry2,rz2 = PtoT(pos)
  3809. local rx,ry,rz = PtoT(pos2)
  3810. local bl2,ch2 = getBlock(rx2,ry2,rz2)
  3811. local bl,ch = getBlock(rx,ry,rz)
  3812. if bl2 and bl2.name then
  3813. local dpos = Vector3.new(rx2,ry2,rz2)*blocksize - pos
  3814. --pos = Vector3.new(pos.X,(ry2*blocksize)+blocksize/2+.1,pos.Z) - dpos/2
  3815. pos = Vector3.new(pos.X,pos.Y,pos.Z) - dpos/2
  3816. vel = Vector3.new(vel.X*.2,1,vel.Z*.2)
  3817. elseif bl and bl.name then
  3818. pos = Vector3.new(pos.X,(ry*blocksize)+blocksize/2+.8,pos.Z)
  3819. vel = Vector3.new(vel.X*0.6,0,vel.Z*0.6)
  3820. end
  3821. end
  3822. ent.pos = pos
  3823. ent.vel = vel
  3824. end
  3825. end
  3826. end
  3827. end
  3828. local cHandle = {}
  3829. function updatePlayers()
  3830. local nulr = {}
  3831. for i,v in pairs(cHandle) do
  3832. if not i:IsDescendantOf(workspace) then
  3833. if v[1] then
  3834. v[1]:Destroy()
  3835. end
  3836. table.insert(nulr,i)
  3837. end
  3838. end
  3839. for _,v in pairs(nulr) do
  3840. cHandle[v] = nil
  3841. end
  3842. for _,v in pairs(game.Players:GetPlayers()) do
  3843. if (v ~= game.Players.LocalPlayer) then
  3844. pcall(function()
  3845. local ch = v.Character
  3846. local htorso = ch and ch:FindFirstChild("HumanoidRootPart")
  3847. if htorso then
  3848. if v.Character:FindFirstChild("Right Arm") then
  3849. if not cHandle[v.Character] then
  3850. cHandle[v.Character] = {}
  3851. end
  3852. local ch = cHandle[v.Character]
  3853.  
  3854. local cname = nil
  3855.  
  3856. local inv = v.Character:FindFirstChild("Inventory")
  3857. local ss = v.Character:FindFirstChild("SelectedSlot")
  3858. if inv and ss then
  3859. local val = inv:FindFirstChild("Slot" .. ss.Value)
  3860. if val then
  3861. local tab = S_H:JSONDecode(val.Value)
  3862. if tab and tab.name and (tab.count > 0) then
  3863. cname = tab.name
  3864. end
  3865. end
  3866. end
  3867.  
  3868. if ch[2] ~= cname then
  3869. ch[2] = cname
  3870. if ch[1] then
  3871. ch[1]:Destroy()
  3872. end
  3873. if ch[2] then
  3874. local item = M_II[ch[2]]
  3875. local part = nil
  3876. local partt = 0
  3877. if item then
  3878. if item.block then
  3879. local block = getBlockModel(item.block)
  3880. if block then
  3881. block = block:Clone()
  3882. block.Size = hs_block
  3883. block.CanCollide = false
  3884. block.Anchored = true
  3885. part = block
  3886. partt = 2
  3887. end
  3888. end
  3889. if not part then
  3890. local tex = (script.ItemTextures:FindFirstChild(item.texture or "missing") or script.ItemTextures.missing):Clone()
  3891. local sgp = Instance.new("Part")
  3892. sgp.Size = hs_mat
  3893. sgp.Transparency = 1
  3894. sgp.CanCollide = false
  3895. sgp.Anchored = true
  3896.  
  3897. local sgui = Instance.new("SurfaceGui")
  3898. sgui.CanvasSize = Vector2.new(32,32)
  3899. sgui.Face = Enum.NormalId.Front
  3900. sgui.LightInfluence = 1
  3901. tex:Clone().Parent = sgui
  3902. local sgui2 = Instance.new("SurfaceGui")
  3903. sgui2.CanvasSize = Vector2.new(32,32)
  3904. sgui2.Face = Enum.NormalId.Back
  3905. sgui.LightInfluence = 1
  3906. tex.Parent = sgui2
  3907.  
  3908. sgui.Parent = sgp
  3909. sgui2.Parent = sgp
  3910.  
  3911. part = sgp
  3912. partt = 1
  3913. end
  3914. end
  3915. if part then
  3916. local hcf = nil
  3917. if partt == 3 then
  3918. hcf = hcf_tool
  3919. elseif partt == 2 then
  3920. hcf = hcf_block
  3921. else
  3922. hcf = hcf_mat
  3923. end
  3924.  
  3925. part.Massless = true
  3926. part.Anchored = false
  3927. part.CFrame = v.Character["Right Arm"].CFrame * hcf
  3928. local wc = Instance.new("WeldConstraint")
  3929. wc.Part0 = v.Character["Right Arm"]
  3930. wc.Part1 = part
  3931. wc.Parent = part
  3932. part.Parent = v.Character
  3933. ch[1] = part
  3934. end
  3935. end
  3936. end
  3937. end
  3938. end
  3939. end)
  3940. end
  3941. end
  3942. end
  3943.  
  3944. S_RS:BindToRenderStep("eloop",Enum.RenderPriority.Camera.Value + 1,updateEntities)
  3945. S_RS:BindToRenderStep("ploop",Enum.RenderPriority.Camera.Value + 1,updatePlayers)
  3946.  
  3947. ----- Chunks & Blocks
  3948.  
  3949. function getChunk(x,y)
  3950. return world[x] and world[x][y]
  3951. end
  3952. function getBlock(x,y,z)
  3953. local pos = Vector3.new(math.floor(x + .5),math.floor(y + .5),math.floor(z + .5))
  3954. local pos2 = Vector3.new(pos.X%16,pos.Y,pos.Z%16)
  3955. local chunk = getChunk(math.floor(pos.X/16),math.floor(pos.Z/16))
  3956. return chunk and chunk[pos2.X] and chunk[pos2.X][pos2.Y] and chunk[pos2.X][pos2.Y][pos2.Z], chunk
  3957. --local chunk = getChunk(math.floor(math.floor(x + .5)/16),math.floor(math.floor(z + .5)/16))
  3958. --local inf = chunk and fastlink[x][y][z]
  3959. --if inf and (inf[2] == chunk) then
  3960. -- return inf[1],inf[2]
  3961. --else
  3962. -- return nil,chunk
  3963. --end
  3964. end
  3965. function PtoT(x,y,z)
  3966. if type(x) == "userdata" then
  3967. x,y,z = x.X,x.Y,x.Z
  3968. end
  3969. return math.floor(x/blocksize + .5),math.floor(y/blocksize + .5),math.floor(z/blocksize + .5)
  3970. end
  3971.  
  3972. ---
  3973.  
  3974. function destroyBlock(x,y,z)
  3975. local bl,ch = getBlock(x,y,z)
  3976. if bl and bl.name then
  3977. local name = bl.name
  3978. ch.change(x%16,y,z%16)
  3979.  
  3980. playSound(Vector3.new(x,y,z)*blocksize,bds[name] or 507863457)
  3981.  
  3982. local bi = M_BI[name]
  3983.  
  3984. if bi and not (bi.blocktype == "nonsolid") then
  3985. for i=1,40 do -- create debris particles
  3986. local p = FX_P:Clone()
  3987. p.CFrame = CFrame.new(Vector3.new(x,y,z)*blocksize + Vector3.new((math.random()-.5)*blocksize,(math.random()-.5)*blocksize,(math.random()-.5)*blocksize))
  3988. p.Velocity = Vector3.new((math.random()-.5)*9,math.random()*6 + 6,(math.random()-.5)*9)
  3989. p.BGui.ImageLabel.Image = "http://www.roblox.com/Thumbs/Asset.ashx?width=420&height=420&assetId=" .. (tex[deb[name]] or "75880927")
  3990. p.BGui.ImageLabel.ImageRectOffset = Vector2.new(math.random(0,360),math.random(0,360))
  3991. local r= math.random()
  3992. p.BGui.Size = UDim2.new(0.3 + r*.25,0,0.3 + r*.25,0)
  3993. p.Parent = workspace.CurrentCamera
  3994.  
  3995. p.CollisionGroupId = S_ReS.PhyGroups.Particles.Value
  3996. game.Debris:AddItem(p,math.random()*2)
  3997. end
  3998. end
  3999. end
  4000. end
  4001. function breakBlock(x,y,z,force)
  4002. if (y < 0) or (y > 255) then return end
  4003. local bl,ch = getBlock(x,y,z)
  4004. if bl and bl.name then
  4005. coroutine.resume(coroutine.create(function() S_ReS.GameRemotes.BreakBlock:InvokeServer(x,y,z,force) end))
  4006. if getGamemode() ~= 1 then
  4007. breaking = Vector3.new(x,y,z)
  4008. local curBreaking = breaking
  4009. local obtainable = true
  4010. local inf = M_BI[bl.name]
  4011. if inf and inf.toolRequire then
  4012. obtainable = false
  4013. end
  4014. breakTimer = (inf and inf.hardness or 1) * (obtainable and 1.5 or 5)
  4015. else
  4016. destroyBlock(x,y,z)
  4017. end
  4018. --wait(2)
  4019. end
  4020. end
  4021. function cancelBlock(x,y,z)
  4022. breaking = nil
  4023. S_ReS.GameRemotes.CancelBlock:InvokeServer(x,y,z)
  4024. end
  4025.  
  4026. function placeBlockFS(x,y,z,name,dat,silent)
  4027. if (y < 0) or (y > 255) then return end
  4028. local bl,ch = getBlock(x,y,z)
  4029. if ch then
  4030. --if not (bl and bl.name) then
  4031. local bi = name and M_BI[name]
  4032. --local useDefBDS = true
  4033. --if info and (not info.useDefaultBDS) then
  4034. --useDefBDS = false
  4035. --end
  4036. if name and (not silent) then
  4037. playSound(Vector3.new(x,y,z)*blocksize,materialsounds[bi and bi.material or "default"] or materialsounds["default"])--(not useDefBDS) and bds[name] or 507863457)
  4038. end
  4039.  
  4040. ch.change(x%16,y,z%16,name,dat)
  4041. end
  4042. end
  4043. function placeBlock(x,y,z,slot,nor,ignchar)
  4044. if (y < 0) or (y > 255) then return end
  4045.  
  4046. local htorso = char and char:FindFirstChild("HumanoidRootPart")
  4047. if htorso then
  4048. local top = (not ignchar) and Vector3.new(PtoT(htorso.Position.X,htorso.Position.Y + 1,htorso.Position.Z))
  4049. local bottom = (not ignchar) and Vector3.new(PtoT(htorso.Position.X,htorso.Position.Y - 2,htorso.Position.Z))
  4050.  
  4051. if ignchar or ((top ~= Vector3.new(x,y,z)) and (bottom ~= Vector3.new(x,y,z))) then
  4052.  
  4053. local bl,ch = getBlock(x,y,z)
  4054. local exist = bl and bl.name
  4055. local inf = exist and M_BI[exist]
  4056. if ch and (not exist) or (inf and (inf.blocktype == "fluid")) then
  4057. local sv = s_inv["Slot" .. slot]
  4058. local tab = S_H:JSONDecode(sv.Value)
  4059. if tab and (tab.count > 0) then
  4060. local iinf = tab.name and M_II[tab.name]
  4061. local name = tab.name
  4062.  
  4063. --local info = blockinfo[name]
  4064. --local useDefBDS = true
  4065. --if info and (not info.useDefaultBDS) then
  4066. -- useDefBDS = false
  4067. --end
  4068. --playSound(Vector3.new(x,y,z)*blocksize,(not useDefBDS) and bds[name] or 507863457)
  4069. local bi = M_BI[name]
  4070. playSound(Vector3.new(x,y,z)*blocksize,materialsounds[bi and bi.material or "default"] or materialsounds["default"])
  4071.  
  4072. local nid = 0
  4073. if not iinf.placeable then nor = getSurfacePosition2(Vector3.new(x,y,z)*3,workspace.CurrentCamera.CFrame.Position) end
  4074. if nor == Vector3.new(0,1,0) then
  4075. nid = 5
  4076. elseif nor == Vector3.new(1,0,0) then
  4077. nid = 1
  4078. elseif nor == Vector3.new(-1,0,0) then
  4079. nid = 2
  4080. elseif nor == Vector3.new(0,0,1) then
  4081. nid = 3
  4082. elseif nor == Vector3.new(0,0,-1) then
  4083. nid = 4
  4084. end
  4085. print(nid)
  4086.  
  4087. ch.change(x%16,y,z%16,name,{
  4088. facing = nid
  4089. })
  4090.  
  4091. if getGamemode() ~= 1 then
  4092. tab.count = tab.count - 1
  4093. sv.Value = S_H:JSONEncode(tab)
  4094. end
  4095.  
  4096. local ok,name = S_ReS.GameRemotes.PlaceBlock:InvokeServer(x,y,z,slot,nor) -- send request to place block xyz as name to server
  4097. if not ok then
  4098. ch.change(x%16,y,z%16,name) -- if unsuccessful, change back to name given by server or air
  4099. end
  4100. end
  4101.  
  4102. end
  4103.  
  4104. end
  4105. end
  4106. end
  4107.  
  4108. function updateBlock(x,y,z,dat)
  4109. if (y < 0) or (y > 255) then return end
  4110. local bl,ch = getBlock(x,y,z)
  4111. if bl and bl.name then
  4112. ch.update(x%16,y,z%16,dat)
  4113. end
  4114. end
  4115.  
  4116. ---
  4117.  
  4118. function totalClosure(block)
  4119. local close = block.closure or 0
  4120. if block.exclosure and (block.exclosure>0) then
  4121. close = close + 1
  4122. end
  4123. if block.eyclosure and (block.eyclosure>0) then
  4124. close = close + 1
  4125. end
  4126. return close
  4127. end
  4128.  
  4129. function createChunk(cx,cy)
  4130. local chunk = {}
  4131. chunk.vfold = Instance.new("Folder")
  4132. chunk.vfold.Name = cx .. "x" .. cy
  4133. chunk.vlfold = Instance.new("Folder")
  4134. chunk.vlfold.Name = "L" .. cx .. "x" .. cy
  4135. spawn(function()
  4136. pcall(function() chunk.vlfold.Parent = vliquid end)
  4137. end)
  4138. chunk.visualize = function(x,y,z)
  4139. local exist = chunk[x] and chunk[x][y] and chunk[x][y][z]
  4140. if exist and exist.name and (not exist.part) then
  4141. local block = exist
  4142. exist.part = exist.name and getBlockModel(exist.name)
  4143.  
  4144. local ws = Vector3.new(cx*16 + x,y,cy*16 + z)
  4145. local binfo = M_BI[exist.name]
  4146. local data = exist.data
  4147.  
  4148. if block.part then
  4149.  
  4150. block.part.CFrame = CFrame.new(ws*blocksize)
  4151.  
  4152. if binfo and binfo.facingPos then
  4153. if data and data.facing and binfo.facingPos[data.facing] then
  4154. block.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[data.facing]
  4155. elseif binfo.facingPosDef and binfo.facingPos[binfo.facingPosDef] then
  4156. block.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[binfo.facingPosDef]
  4157. end
  4158. else
  4159. local maxd = fMaxDepth[block.name]
  4160. if block.depth and maxd then
  4161. local ws = Vector3.new(cx*16 + x,y,cy*16 + z)
  4162. block.part.CFrame = CFrame.new(ws*blocksize) * CFrame.new(0,-block.depth/(maxd+1) * blocksize,0)
  4163. end
  4164. end
  4165.  
  4166. local inf = M_BI[block.part.Name]
  4167.  
  4168. if totalClosure(block) < 6 then
  4169. if inf and (inf.blocktype == "fluid") then
  4170. block.part.Parent = chunk.vlfold
  4171. else
  4172. block.part.Parent = chunk.vfold
  4173. end
  4174. end
  4175.  
  4176. block.part.CollisionGroupId = S_ReS.PhyGroups.World.Value
  4177.  
  4178. -- for _,v in pairs(block.part:GetChildren()) do
  4179. -- if v:IsA("Decal") then
  4180. -- if (v.Face ~= Enum.NormalId.Right) then
  4181. -- v.Color3 = Color3.new(0.6,0.6,0.6)
  4182. -- end
  4183. -- end
  4184. -- end
  4185.  
  4186. end
  4187. end
  4188. end
  4189. spawn(function()
  4190. --pcall(function()
  4191. for xx,xt in pairs(chunk) do
  4192. if type(xt) == "table" then
  4193. for yy,yt in pairs(xt) do
  4194. for zz,tab in pairs(yt) do
  4195. if totalClosure(tab) < 6 then
  4196. chunk.visualize(xx,yy,zz)
  4197. end
  4198. end
  4199. end
  4200. end
  4201. end
  4202. do local cc = getChunk(cx,cy-1)
  4203. if cc then
  4204. for xx,xt in pairs(cc) do
  4205. if type(xt) == "table" then
  4206. for yy,yt in pairs(xt) do
  4207. local z = yt[15]
  4208. if z and z.name then
  4209. local c,ch = getBlock(xx + cx*16,yy,cy*16)
  4210. if ch then
  4211. local cv = 0
  4212. if c and c.name then
  4213. local info = blockinfo[c.name]
  4214. cv = (info and info.closeValue) or 1
  4215. end
  4216. z.eyclosure = math.clamp(cv,0,1)
  4217. if (cc.vfold.Parent) and (totalClosure(z) < 6) then
  4218. if z.part then
  4219. pcall(function()
  4220. local inf = M_BI[z.part.Name]
  4221. if inf and (inf.blocktype == "fluid") then
  4222. z.part.Parent = cc.vlfold
  4223. else
  4224. z.part.Parent = cc.vfold
  4225. end
  4226. end)
  4227. else
  4228. cc.visualize(xx,yy,15)
  4229. end
  4230. end
  4231. end
  4232. end
  4233. end
  4234. end
  4235. end
  4236. end
  4237. end
  4238. do local cc = getChunk(cx,cy+1)
  4239. if cc then
  4240. for xx,xt in pairs(cc) do
  4241. if type(xt) == "table" then
  4242. for yy,yt in pairs(xt) do
  4243. local z = yt[0]
  4244. if z and z.name then
  4245. local c,ch = getBlock(xx + cx*16,yy,15 + cy*16)
  4246. if ch then
  4247. local cv = 0
  4248. if c and c.name then
  4249. local info = blockinfo[c.name]
  4250. cv = (info and info.closeValue) or 1
  4251. end
  4252. z.eyclosure = math.clamp(cv,0,1)
  4253. if (cc.vfold.Parent) and (totalClosure(z) < 6) then
  4254. if z.part then
  4255. pcall(function()
  4256. local inf = M_BI[z.part.Name]
  4257. if inf and (inf.blocktype == "fluid") then
  4258. z.part.Parent = cc.vlfold
  4259. else
  4260. z.part.Parent = cc.vfold
  4261. end
  4262. end)
  4263. else
  4264. cc.visualize(xx,yy,0)
  4265. end
  4266. end
  4267. end
  4268. end
  4269. end
  4270. end
  4271. end
  4272. end
  4273. end
  4274. do local cc = getChunk(cx+1,cy)
  4275. if cc then
  4276. for yy,yt in pairs(cc[0]) do
  4277. for zz,z in pairs(yt) do
  4278. if z and z.name then
  4279. local c,ch = getBlock(15 + cx*16,yy,zz + cy*16)
  4280. if ch then
  4281. local cv = 0
  4282. if c and c.name then
  4283. local info = blockinfo[c.name]
  4284. cv = (info and info.closeValue) or 1
  4285. end
  4286. z.exclosure = math.clamp(cv,0,1)
  4287. if (cc.vfold.Parent) and (totalClosure(z) < 6) then
  4288. if z.part then
  4289. pcall(function()
  4290. local inf = M_BI[z.part.Name]
  4291. if inf and (inf.blocktype == "fluid") then
  4292. z.part.Parent = cc.vlfold
  4293. else
  4294. z.part.Parent = cc.vfold
  4295. end
  4296. end)
  4297. else
  4298. cc.visualize(0,yy,zz)
  4299. end
  4300. end
  4301. end
  4302. end
  4303. end
  4304. end
  4305. end
  4306. end
  4307. do local cc = getChunk(cx-1,cy)
  4308. if cc then
  4309. for yy,yt in pairs(cc[15]) do
  4310. for zz,z in pairs(yt) do
  4311. if z and z.name then
  4312. local c,ch = getBlock(cx*16,yy,zz + cy*16)
  4313. if ch then
  4314. local cv = 0
  4315. if c and c.name then
  4316. local info = blockinfo[c.name]
  4317. cv = (info and info.closeValue) or 1
  4318. end
  4319. z.exclosure = math.clamp(cv,0,1)
  4320. if (cc.vfold.Parent) and (totalClosure(z) < 6) then
  4321. if z.part then
  4322. pcall(function()
  4323. local inf = M_BI[z.part.Name]
  4324. if inf and (inf.blocktype == "fluid") then
  4325. z.part.Parent = cc.vlfold
  4326. else
  4327. z.part.Parent = cc.vfold
  4328. end
  4329. end)
  4330. else
  4331. cc.visualize(15,yy,zz)
  4332. end
  4333. end
  4334. end
  4335. end
  4336. end
  4337. end
  4338. end
  4339. end
  4340. --end)
  4341. wait()
  4342. pcall(function() chunk.vfold.Parent = vblocks end)
  4343. end)
  4344. chunk.change = function(x,y,z,name,data)
  4345. if (x < 0) or (x > 15)
  4346. or (y < 0) or (y > 255)
  4347. or (z < 0) or (z > 15)
  4348. then return end
  4349.  
  4350. --if chunk.vfold.Parent then print(x,y,z,name) end
  4351.  
  4352. local success = false
  4353.  
  4354. local block = {
  4355. name = name,
  4356. --part = name and script.Blocks[name]:Clone(),
  4357. data = data,
  4358. depth = data and data.depth,
  4359. closure = 0,
  4360. --exclosure = 0,
  4361. --eyclosure = 0
  4362. }
  4363.  
  4364. if (x == 0) then
  4365. local bl,ch = getBlock(x-1 + cx*16,y,z + cy*16)
  4366. if (bl and bl.name) or (not ch) then
  4367. block.exclosure = 1
  4368. elseif not (bl and bl.name) then
  4369. block.exclosure = 0
  4370. end
  4371. elseif (x == 15) then
  4372. local bl,ch = getBlock(x+1 + cx*16,y,z + cy*16)
  4373. if (bl and bl.name) or (not ch) then
  4374. block.exclosure = 1
  4375. elseif not (bl and bl.name) then
  4376. block.exclosure = 0
  4377. end
  4378. end
  4379. if (z == 0) then
  4380. local bl,ch = getBlock(x + cx*16,y,z-1 + cy*16)
  4381. if (bl and bl.name) or (not ch) then
  4382. block.eyclosure = 1
  4383. elseif not (bl and bl.name) then
  4384. block.eyclosure = 0
  4385. end
  4386. elseif (z == 15) then
  4387. local bl,ch = getBlock(x + cx*16,y,z+1 + cy*16)
  4388. if (bl and bl.name) or (not ch) then
  4389. block.eyclosure = 1
  4390. elseif not (bl and bl.name) then
  4391. block.eyclosure = 0
  4392. end
  4393. end
  4394.  
  4395. local ws = Vector3.new(cx*16 + x,y,cy*16 + z)
  4396. local binfo = M_BI[name]
  4397.  
  4398.  
  4399.  
  4400. -- if block.part then
  4401. --
  4402. -- block.part.CFrame = CFrame.new(ws*blocksize)
  4403. --
  4404. -- if binfo and binfo.facingPos then
  4405. -- if data and data.facing and binfo.facingPos[data.facing] then
  4406. -- block.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[data.facing]
  4407. -- elseif binfo.facingPosDef and binfo.facingPos[binfo.facingPosDef] then
  4408. -- block.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[binfo.facingPosDef]
  4409. -- end
  4410. -- end
  4411. --
  4412. -- local inf = M_BI[block.part.Name]
  4413. -- if inf and (inf.blocktype == "fluid") then
  4414. -- block.part.Parent = chunk.vlfold
  4415. -- else
  4416. -- block.part.Parent = chunk.vfold
  4417. -- end
  4418. --
  4419. -- block.part.CollisionGroupId = S_ReS.PhyGroups.World.Value
  4420. --
  4421. ---- for _,v in pairs(block.part:GetChildren()) do
  4422. ---- if v:IsA("Decal") then
  4423. ---- if (v.Face ~= Enum.NormalId.Right) then
  4424. ---- v.Color3 = Color3.new(0.6,0.6,0.6)
  4425. ---- end
  4426. ---- end
  4427. ---- end
  4428. --
  4429. -- end
  4430.  
  4431. if binfo and binfo.facingPos then
  4432. block.facing = (data and data.facing) or (binfo and binfo.facingPosDef) or 0
  4433. end
  4434.  
  4435. chunk[x] = chunk[x] or {}
  4436. chunk[x][y] = chunk[x][y] or {}
  4437. local exist = chunk[x][y][z]
  4438. if exist and exist.name and exist.part then
  4439. exist.part:Destroy()
  4440. end
  4441. local keepclosure = false
  4442. if exist and exist.closure then
  4443. block.closure = exist.closure
  4444. if exist.name and name then
  4445. keepclosure = true
  4446. end
  4447. --if (totalClosure(block) >= 6) and block.part then
  4448. -- block.part.Parent = nil
  4449. --end
  4450. end
  4451. success = ((not name) and exist and exist.name) or (name and ((not exist) or (exist and (exist.name ~= name))))
  4452. --if not nopt then print(success) end
  4453. chunk[x][y][z] = block
  4454. --fastlink[x+cx*16][y][z+cy*16] = {block,chunk}
  4455. local function gc(x2,y2,z2,c)
  4456. --if (x2 < 0) or (x2 > 15)
  4457. --or (y2 < 0) or (y2 > 255)
  4458. --or (z2 < 0) or (z2 > 15)
  4459. --then return end
  4460. c = c or 1
  4461.  
  4462. if (y2 < 0) or (y2 > 255) then return
  4463. elseif (x2 < 0) or (x2 > 15) then
  4464. local block,ch = getBlock(x2 + cx*16,y2,z2 + cy*16)
  4465. if block then
  4466. block.exclosure = math.clamp(c,0,1)
  4467. if (not block.part) and ch.vfold.Parent then
  4468. ch.visualize(x2%16,y2,z2)
  4469. end
  4470. if block.part then
  4471. if (totalClosure(block) >= 6) then
  4472. block.part.Parent = nil
  4473. elseif (totalClosure(block) < 6) and not block.part.Parent then
  4474. pcall(function() block.part.Parent = chunk.vfold end) -- destroyers
  4475. end
  4476. end
  4477. end
  4478. return
  4479. elseif (z2 < 0) or (z2 > 15) then
  4480. local block,ch = getBlock(x2 + cx*16,y2,z2 + cy*16)
  4481. if block then
  4482. block.eyclosure = math.clamp(c,0,1)
  4483. if (not block.part) and ch.vfold.Parent then
  4484. ch.visualize(x2,y2,z2%16)
  4485. end
  4486. if block.part then
  4487. if (totalClosure(block) >= 6) then
  4488. block.part.Parent = nil
  4489. elseif (totalClosure(block) < 6) and not block.part.Parent then
  4490. pcall(function() block.part.Parent = chunk.vfold end)
  4491. end
  4492. end
  4493. end
  4494. return
  4495. end
  4496.  
  4497. chunk[x2] = chunk[x2] or {}
  4498. chunk[x2][y2] = chunk[x2][y2] or {}
  4499. chunk[x2][y2][z2] = chunk[x2][y2][z2] or {}
  4500. local block = chunk[x2][y2][z2]
  4501. block.closure = math.clamp(block.closure and (block.closure + c) or c,0,6)
  4502. --if not nopt then
  4503. --print(x,y,z,";",x2,y2,z2,";",chunk[x2][y2][z2]["closure"])
  4504. --end
  4505. if (not block.part) and chunk.vfold.Parent then
  4506. chunk.visualize(x2,y2,z2)
  4507. end
  4508. if block.part then
  4509. if (totalClosure(block) >= 6) then
  4510. block.part.Parent = nil
  4511. elseif (totalClosure(block) < 6) and not block.part.Parent then
  4512. pcall(function() block.part.Parent = chunk.vfold end)
  4513. end
  4514. end
  4515. end
  4516. local info = name and blockinfo[name]
  4517. local blockval = (info and info.closeValue) or 1
  4518. if success and (blockval > 0) and (not keepclosure) then
  4519. --if success then
  4520. gc(x,y,z+1,not name and -1)
  4521. gc(x,y,z-1,not name and -1)
  4522. gc(x,y+1,z,not name and -1)
  4523. gc(x,y-1,z,not name and -1)
  4524. gc(x+1,y,z,not name and -1)
  4525. gc(x-1,y,z,not name and -1)
  4526. --end
  4527. end
  4528.  
  4529. --if (totalClosure(block) < 6) and (not block.part) then
  4530. if (not block.part) and chunk.vfold.Parent then
  4531. --print("DOOM")
  4532. chunk.visualize(x,y,z)
  4533. --elseif chunk.vfold.Parent then
  4534. --print(block.part:GetFullName())
  4535. end
  4536.  
  4537. if block and block.part and block.name then
  4538. local maxd = fMaxDepth[block.name]
  4539. if block.depth and maxd then
  4540. local ws = Vector3.new(cx*16 + x,y,cy*16 + z)
  4541. block.part.CFrame = CFrame.new(ws*blocksize) * CFrame.new(0,-block.depth/(maxd+1) * blocksize,0)
  4542. end
  4543. end
  4544.  
  4545. if tarUsedBlock then
  4546. if ((x+cx*16) == tarUsedBlock.X) and (y == tarUsedBlock.Y) and ((z+cy*16) == tarUsedBlock.Z) then
  4547. updateExternals()
  4548. end
  4549. end
  4550. --end
  4551.  
  4552. return block,success
  4553. end
  4554. chunk.update = function(x,y,z,dat)
  4555. chunk[x] = chunk[x] or {}
  4556. chunk[x][y] = chunk[x][y] or {}
  4557. local exist = chunk[x][y][z]
  4558. if exist and exist.name and exist.part then
  4559. for i,v in pairs(dat) do
  4560. exist[i] = v
  4561. end
  4562. if exist.dstage and (exist.dstage >= 0) and (exist.dstage < 10) then
  4563. local left = {}
  4564. for _,v in pairs(exist.part:GetChildren()) do
  4565. if v.Name == "BreakSG" then
  4566. left[v.Face] = true
  4567. for i=0,exist.dstage do
  4568. v["Stage" .. i].Visible = true
  4569. end
  4570. end
  4571. end
  4572. for _,v in pairs(Enum.NormalId:GetEnumItems()) do
  4573. if not left[v] then
  4574. local bsg = script.BreakSG:Clone()
  4575. bsg.Face = v
  4576. for i=0,exist.dstage do
  4577. bsg["Stage" .. i].Visible = true
  4578. end
  4579. bsg.Parent = exist.part
  4580. end
  4581. end
  4582. else
  4583. for _,v in pairs(exist.part:GetChildren()) do
  4584. if v.Name == "BreakSG" then
  4585. v:Destroy()
  4586. end
  4587. end
  4588. end
  4589. if exist.part then
  4590.  
  4591. local binfo = M_BI[exist.name]
  4592. local ws = Vector3.new(cx*16 + x,y,cy*16 + z)
  4593.  
  4594. exist.part.CFrame = CFrame.new(ws*blocksize)
  4595.  
  4596. if binfo and binfo.facingPos then
  4597. if exist.facing and binfo.facingPos[exist.facing] then
  4598. exist.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[exist.facing]
  4599. elseif binfo.facingPosDef and binfo.facingPos[binfo.facingPosDef] then
  4600. exist.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[binfo.facingPosDef]
  4601. end
  4602. end
  4603. end
  4604. end
  4605. end
  4606. world[cx] = world[cx] or {}
  4607. world[cx][cy] = chunk
  4608. return chunk
  4609. end
  4610.  
  4611. function loadChunk(x,y,data)
  4612. local chunk = getChunk(x,y) or createChunk(x,y)
  4613. for xx,xt in pairs(data) do
  4614. --print("X " .. xx .. " ------")
  4615. for yy,yt in pairs(xt) do
  4616. --print("\tY " .. yy .. " ------")
  4617. for zz,bl in pairs(yt) do
  4618. if bl.name then
  4619. --print("\t\tZ " .. zz .. " ------ " .. bl.name)
  4620. chunk.change(tonumber(xx),tonumber(yy),tonumber(zz),bl.name,bl)
  4621. end
  4622. end
  4623. end
  4624. end
  4625. end
  4626. function loadServerChunk(x,y)
  4627. local chunk = getChunk(x,y)
  4628. if (not chunk) and (not (loadingChunks[x] and loadingChunks[x][y])) then
  4629. loadingChunks[x] = loadingChunks[x] or {}
  4630. loadingChunks[x][y] = true
  4631. coroutine.resume(coroutine.create(function()
  4632. local dat = game.ReplicatedStorage.VisualRemotes.GetChunk:InvokeServer(x,y)
  4633. loadChunk(x,y,dat)
  4634. loadingChunks[x][y] = false
  4635. end))
  4636. end
  4637. end
  4638.  
  4639. S_ReS.GameRemotes.OnPlaceBlock.OnClientEvent:Connect(function(by,x,y,z,name,dat,silent)
  4640. if plr ~= by then
  4641. placeBlockFS(x,y,z,name,dat,silent)
  4642. end
  4643. end)
  4644. S_ReS.GameRemotes.OnBreakBlock.OnClientEvent:Connect(function(by,x,y,z)
  4645. if (getGamemode() ~= 1) or (plr ~= by) then
  4646. destroyBlock(x,y,z)
  4647. end
  4648. end)
  4649. S_ReS.VisualRemotes.UpdateBlock.OnClientEvent:Connect(function(x,y,z,dat)
  4650. --print("Got",x,y,z,dat)
  4651. updateBlock(x,y,z,dat)
  4652. end)
  4653. S_ReS.VisualRemotes.BlockChanged.OnClientEvent:Connect(function(x,y,z,name,dat)
  4654. --print("Got",x,y,z)
  4655. local bl,ch = getBlock(x,y,z)
  4656. --print(bl and bl.name)
  4657. if ch then
  4658. ch.change(x%16,y,z%16,name)
  4659. end
  4660. end)
  4661.  
  4662. ----- Camera based functions
  4663.  
  4664. --local FOVTar = 70 + char.Humanoid.WalkSpeed
  4665.  
  4666. local walk = 0
  4667. local walkC = 0
  4668. local walkS = false
  4669.  
  4670. local hrollTar = 0
  4671. local hrollCur = 0
  4672.  
  4673. local pitchCur = 0
  4674.  
  4675. local last_cam_rx = 0
  4676.  
  4677. local lastCF = workspace.CurrentCamera.CFrame
  4678.  
  4679. function beforeCam()
  4680. workspace.CurrentCamera.CFrame = lastCF
  4681. end
  4682.  
  4683. local hand = nil
  4684. local hand_type = 0
  4685. local hand_prev = nil
  4686. local hand_lastN = nil
  4687.  
  4688. local cam_mx = 0
  4689. local cam_my = 0
  4690. local cam_mx2 = 0
  4691. local cam_my2 = 0
  4692.  
  4693. function mainCam(dt)
  4694. ----- Camera Setting -----
  4695.  
  4696. -- set the lastCF
  4697. local delta = workspace.CurrentCamera.CFrame * lastCF:Inverse()
  4698. delta = CFrame.new(Vector3.new(),delta.LookVector)
  4699. local temp_x = lastCF:ToEulerAnglesYXZ()
  4700. local d_x = temp_x - last_cam_rx
  4701. last_cam_rx = temp_x
  4702. local _,d_y = delta:ToEulerAnglesYXZ()
  4703. lastCF = workspace.CurrentCamera.CFrame
  4704.  
  4705. local wx = math.sin(-walk)/6 * walkC
  4706. local wy = (math.abs(math.cos(walk))/4) * walkC
  4707. local wrx = (-math.abs(math.cos(walk))/90) * walkC
  4708. local wrz = math.sin(-walk)/200 * walkC
  4709.  
  4710. cam_mx = cam_mx - d_x
  4711. cam_my = cam_my - d_y
  4712. cam_mx = math.clamp(lerp(cam_mx,0,0.3),-.1,.1)
  4713. cam_my = math.clamp(lerp(cam_my,0,0.3),-.1,.1)
  4714. cam_mx2 = lerp(cam_mx2,cam_mx,0.7)
  4715. cam_my2 = lerp(cam_my2,cam_my,0.7)
  4716. --print(wy)
  4717.  
  4718. --local char = plr.Character
  4719. local human = char and char:FindFirstChild("Humanoid")
  4720. local htorso = char and char:FindFirstChild("HumanoidRootPart")
  4721.  
  4722. local function doFootstep()
  4723. if grounded then
  4724. local pos = htorso.Position + Vector3.new(0,-3 - blocksize/2,0)
  4725. local bl,ch = getBlock(PtoT(pos.X,pos.Y,pos.Z))
  4726. if bl and bl.name then
  4727. local bi = M_BI[bl.name]
  4728. if bi then
  4729. --print("Footstep")
  4730. local mat = materialsounds[bi.material or "default"] or materialsounds["default"]
  4731. playSound(htorso.Position + Vector3.new(0,-3,0),mat)
  4732. end
  4733. end
  4734. end
  4735. end
  4736.  
  4737. if human and htorso then
  4738. local head,torso = char:FindFirstChild("Head"),char:FindFirstChild("Torso")
  4739. if head and torso then
  4740. local neck = torso:FindFirstChild("Neck")
  4741. if neck then
  4742. local xx,yy,zz = workspace.CurrentCamera.CFrame:ToEulerAnglesYXZ()
  4743. game.ReplicatedStorage.VisualRemotes.ChangeNeckWeld:FireServer(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0) * CFrame.Angles(-xx,0,0))
  4744. end
  4745. end
  4746. local lv = workspace.CurrentCamera.CFrame.LookVector
  4747. local rlv = Vector3.new(lv.X,0,lv.Z)
  4748. --print(htorso.Velocity.Y / (math.abs(htorso.Velocity.Y+1)^2))
  4749. local vel = htorso.Velocity
  4750. if (human.MoveDirection.Magnitude > 0) and grounded then
  4751. walk = (walk + Vector3.new(vel.X,0,vel.Z).Magnitude/blocksize*1.8 * dt)%(math.pi*2)
  4752. walkC = lerp(walkC,1,0.1)
  4753. if ((walk >= math.pi*1.5) or (walk < math.pi*.5)) and (not walkS) then
  4754. walkS = true
  4755. doFootstep()
  4756. elseif ((walk < math.pi*1.5) and (walk >= math.pi*.5)) and (walkS) then
  4757. walkS = false
  4758. doFootstep()
  4759. end
  4760. else
  4761. --walk = 0
  4762. walkC = lerp(walkC,0,0.2)
  4763. end
  4764. pitchCur = lerp(pitchCur,math.tanh(htorso.Velocity.Y/100)/10,0.4)
  4765. end
  4766.  
  4767. hrollTar = (1 - math.clamp(hurttimer*12 - .1,0,1)) * 1
  4768. hrollCur = lerp(hrollCur,hrollTar,0.15)
  4769.  
  4770. if human then human.CameraOffset = Vector3.new(0 + wx,0.3 + wy,0) end
  4771. local camcf = workspace.CurrentCamera.CFrame * CFrame.new(0,0,-.45) * CFrame.Angles(temp_x*0.125,0,0)
  4772. workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0,0,-.45) * CFrame.Angles(temp_x*0.125 + pitchCur + wrx,0,hrollCur + wrz)
  4773.  
  4774. ----- Hand -----
  4775.  
  4776. if not (hand and hand.Parent) then
  4777. hand = script.Hand:Clone()
  4778. hand.Parent = workspace.CurrentCamera
  4779. end
  4780. local name = nil
  4781. if hand and selSlotV then
  4782. local tab = S_H:JSONDecode(selSlotV.Value)
  4783. if tab.name and (tab.count > 0) then
  4784. name = tab.name
  4785. end
  4786. end
  4787.  
  4788. --print(name,hand_lastN)
  4789. if name ~= hand_lastN then
  4790. hand_lastN = name
  4791. if name then
  4792. local item = M_II[name]
  4793. local part = nil
  4794. if item then
  4795. if item.block then
  4796. local block = getBlockModel(item.block)
  4797. if block then
  4798. block = block:Clone()
  4799. block.Size = Vector3.new(.35,.35,.35)*2
  4800. block.CanCollide = false
  4801. block.Anchored = true
  4802. hand_type = 1
  4803. part = block
  4804. end
  4805. end
  4806. if not part then
  4807. local tex = (script.ItemTextures:FindFirstChild(item.texture or "missing") or script.ItemTextures.missing):Clone()
  4808. local sgp = Instance.new("Part")
  4809. sgp.Size = Vector3.new(1.5,1.5,0.05)
  4810. sgp.Transparency = 1
  4811. sgp.CanCollide = false
  4812. sgp.Anchored = true
  4813.  
  4814. local sgui = Instance.new("SurfaceGui")
  4815. sgui.CanvasSize = Vector2.new(32,32)
  4816. sgui.Face = Enum.NormalId.Front
  4817. sgui.LightInfluence = 1
  4818. tex:Clone().Parent = sgui
  4819. local sgui2 = Instance.new("SurfaceGui")
  4820. sgui2.CanvasSize = Vector2.new(32,32)
  4821. sgui2.Face = Enum.NormalId.Back
  4822. sgui.LightInfluence = 1
  4823. tex.Parent = sgui2
  4824.  
  4825. sgui.Parent = sgp
  4826. sgui2.Parent = sgp
  4827.  
  4828. hand_type = 2
  4829. part = sgp
  4830. end
  4831. end
  4832. hand:Destroy()
  4833. if part then
  4834. part.Parent = workspace.CurrentCamera
  4835. hand = part
  4836. end
  4837. else
  4838. hand:Destroy()
  4839. hand_type = 0
  4840. hand = script.Hand:Clone()
  4841. hand.Parent = workspace.CurrentCamera
  4842. end
  4843. end
  4844. if human then
  4845. local at = .25
  4846. bob_attack = math.clamp(bob_attack,0,at)
  4847. local a = bob_attack/at
  4848. local c = math.sin(-a*4)
  4849. local d = math.sin((a^(1/3))*1.6)
  4850. local val1 = workspace.Val1.Value
  4851. local val2 = workspace.Val2.Value
  4852. local camcf = camcf * CFrame.fromEulerAnglesYXZ(cam_mx2,cam_my2,0)
  4853. if hand_type == 0 then
  4854. local b = math.sin(a*2.2)
  4855. hand.CFrame = camcf * CFrame.new(-human.CameraOffset/2.3) * CFrame.new(0.5+(b*-.21), -0.51+(c*.45), -0.6+(b*-.12)) * CFrame.fromEulerAnglesYXZ(math.rad(-23+(-2*d)),math.rad(-90+(65*d)),math.rad(-135+(5*d)))
  4856. elseif hand_type == 1 then
  4857. local b = math.sin(a*2.618)*2
  4858. --hand.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(-human.CameraOffset/2.3) * CFrame.new(0.48+(b*-.21), -0.335+(c*.45), -0.6+(b*-.12)) * CFrame.fromEulerAnglesYXZ(math.rad(0+(-2*d)),math.rad(-135+(65*d)),math.rad(0+(5*d)))
  4859. hand.CFrame = camcf * CFrame.new(-human.CameraOffset/2.3 * 2) * CFrame.new(Vector3.new(0.48+(b*-.21), -0.335+(c*.2), -0.6+(b*-.025))*2) * CFrame.fromEulerAnglesYXZ(math.rad(0+(61*d)),math.rad(-135+(12*d)),math.rad(0+(19*d)))
  4860. elseif hand_type == 2 then
  4861. local b = math.sin(a*2.718)*2
  4862. local b2 = math.sin(a*2.8)*1.24
  4863. local c = math.sin(-a*4.7)
  4864. c = (c<0) and c*1.5 or c
  4865. hand.CFrame = camcf * CFrame.new(-human.CameraOffset/2.9 * 3) * CFrame.new(Vector3.new(0.36+(-.28*b2), -0.1+(c*.16), -0.37+(-.23*b))*3) * CFrame.fromEulerAnglesYXZ(math.rad(0+(-22*d)),math.rad(90+(25*d)),math.rad(-23+(-57*b)))
  4866. end
  4867. bob_attack = math.clamp(bob_attack - dt,0,at)
  4868. end
  4869.  
  4870. ----- Lighting -----
  4871.  
  4872. local fogc = Vector3.new(217, 236, 255)/255
  4873. local foge = 200
  4874.  
  4875. local tp = workspace.CurrentCamera.CFrame.Position
  4876. local bl,ch = getBlock(PtoT(tp.X,tp.Y,tp.Z))
  4877. local exist = bl and bl.name
  4878. local inf = exist and M_BI[exist]
  4879.  
  4880. L_CC.Brightness = 0
  4881. L_CC.Contrast = -.1
  4882. L_CC.Saturation = -.2
  4883. L_CC.TintColor = Color3.new(1,1,1)
  4884.  
  4885. local isBreathable = (not exist) or (inf.blocktype == "fluid") or (inf.blocktype == "nonsolid")
  4886. if not isBreathable then
  4887. if sufftimer <= 0 then
  4888. reqDamage(5,"suffocation")
  4889. --game.ReplicatedStorage.GameRemotes.RequestDamage:FireServer(5,"suffocation")
  4890. sufftimer = sufftimer + 0.5
  4891. end
  4892. sufftimer = sufftimer - dt
  4893.  
  4894. L_CC.Brightness = -.2
  4895. L_CC.Contrast = -.1
  4896. L_CC.Saturation = -.2
  4897. L_CC.TintColor = Color3.new(1,1,1)
  4898. elseif exist == "Water" then
  4899. fogc = Vector3.new(43, 123, 119)/255
  4900. foge = 50
  4901.  
  4902. L_CC.Brightness = -.1
  4903. L_CC.Contrast = -.1
  4904. L_CC.Saturation = -.2
  4905. L_CC.TintColor = Color3.new(198/255,251/255,1)
  4906. elseif exist == "Lava" then
  4907. fogc = Vector3.new(245, 101, 10)/255
  4908. foge = 12
  4909.  
  4910. L_CC.Brightness = .2
  4911. L_CC.Contrast = -.4
  4912. L_CC.Saturation = -.5
  4913. L_CC.TintColor = Color3.new(1,132/255,30/255)
  4914. end
  4915.  
  4916. local ct = game.Lighting.ClockTime
  4917. local cd = (ct < 12) and (math.clamp(ct-6,0,1)) or (1-math.clamp(ct-17,0,1))
  4918.  
  4919. local fog = fogc*cd
  4920. game.Lighting.FogColor = Color3.new(fog.X,fog.Y,fog.Z)
  4921. game.Lighting.FogEnd = foge
  4922. game.Lighting.FogStart = foge/4
  4923.  
  4924. --print(math.deg(workspace.CurrentCamera.CFrame:ToEulerAnglesYXZ()))
  4925.  
  4926. -- update info
  4927.  
  4928. local lposs = workspace.CurrentCamera.CFrame.Position
  4929. local lpos = Vector3.new(math.floor((lposs.X+ .5*blocksize)/blocksize),math.floor((lposs.Y+ .5*blocksize)/blocksize) - 1,math.floor((lposs.Z+ .5*blocksize)/blocksize))
  4930.  
  4931. hurttimer = math.clamp(hurttimer + dt,0,10)
  4932. voidtimer = math.max(voidtimer - dt,0)
  4933. if p_gui:FindFirstChild("HUDGui") then
  4934. p_gui.HUDGui.DataFrame.Coord.Text = "Coordinates: " .. lpos.X .. " " .. lpos.Y .. " " .. lpos.Z
  4935. p_gui.HUDGui.DataFrame.ServerAge.Text = "Svr. age (real time): " .. getTimeFromSeconds(workspace.ServerInfo.ServerAge.Value)
  4936. p_gui.HUDGui.DataFrame.GameAge.Text = "Game age: " .. getTimeFromSeconds(workspace.ServerInfo.GameAge.Value)
  4937. end
  4938. end
  4939.  
  4940. S_RS:BindToRenderStep("NS_cam_bf",Enum.RenderPriority.Input.Value - 1,beforeCam)
  4941. S_RS:BindToRenderStep("NS_cam",Enum.RenderPriority.Camera.Value + 1,mainCam)
  4942.  
  4943. S_RS:BindToRenderStep("vloop",Enum.RenderPriority.Camera.Value + 1,function(dt)
  4944. rmouse.Icon = invOpen and "" or "rbxasset://textures/Blank.png"
  4945.  
  4946. if char and char:FindFirstChild("Humanoid") then
  4947. workspace.CurrentCamera.FieldOfView = lerp(workspace.CurrentCamera.FieldOfView,54 + char.Humanoid.WalkSpeed*2,0.25)
  4948. else
  4949. workspace.CurrentCamera.FieldOfView = 80
  4950. end
  4951. --print("Timer:",breakTimer)
  4952.  
  4953. --
  4954.  
  4955. local ch = char
  4956. if ch then
  4957.  
  4958. local human = ch:FindFirstChild("Humanoid")
  4959. if human then
  4960.  
  4961. human.HipHeight = 0.1--0.4
  4962. --human.CameraOffset = Vector3.new(0,-human.HipHeight + .4,0)
  4963. end
  4964.  
  4965. local cf,block,nor = mouse:ProjectMouseRay2({vblocks})
  4966. local cf2,partp,nor2 = mouse:ProjectMouseRay({workspace.CurrentCamera,vliquid,char})
  4967.  
  4968. if partp and partp.Parent and ((cf2.Position - workspace.CurrentCamera.CFrame.Position).Magnitude < 8) and game.Players:GetPlayerFromCharacter(partp.Parent) then
  4969. tarPlayer = partp.Parent
  4970. else
  4971. tarPlayer = nil
  4972. end
  4973.  
  4974. if (cf.Position - workspace.CurrentCamera.CFrame.Position).Magnitude < (5*blocksize) then
  4975.  
  4976. tarBlock = block
  4977. if block then
  4978. tarDir = nor
  4979. if abreak and (getGamemode() ~= 1) then
  4980. local pos = Vector3.new(PtoT(block.Position.X,block.Position.Y,block.Position.Z))
  4981. if (breaking ~= pos) then
  4982. --print("Ok new one")
  4983. breakBlock(pos.X,pos.Y,pos.Z,true)
  4984. elseif breaking then
  4985. --print("Timer Before:",breakTimer)
  4986. breakTimer = breakTimer - dt
  4987. breakDTimer = breakDTimer - dt
  4988. breakSTimer = breakSTimer - dt
  4989. if breakSTimer <= 0 then
  4990. bob_attack = 10
  4991. breakSTimer = .2
  4992. local bi = M_BI[block.Name]
  4993. if bi then
  4994. --print("Footstep")
  4995. local mat = materialsounds[bi.material or "default"] or materialsounds["default"]
  4996. local s = playSound((Vector3.new(pos.X,pos.Y,pos.Z)+ nor/2)*blocksize,mat,.6 + math.random()*.05,.55)
  4997. if s then
  4998. local ee = Instance.new("EqualizerSoundEffect")
  4999. ee.HighGain = -1
  5000. ee.MidGain = -1
  5001. ee.LowGain = -4
  5002. ee.Parent = s
  5003. end
  5004. end
  5005. end
  5006. if breakDTimer <= 0 then
  5007. breakDTimer = .25
  5008. for i=1,math.random(2,5) do -- create debris particles
  5009. local p = FX_P:Clone()
  5010. p.CFrame = CFrame.new((Vector3.new(pos.X,pos.Y,pos.Z)+ nor/2)*blocksize + Vector3.new((math.random()-.5),(math.random()-.5),(math.random()-.5)))
  5011. p.Velocity = Vector3.new((math.random()-.5)*9,math.random()*6 + 6,(math.random()-.5)*9)
  5012. p.BGui.ImageLabel.Image = "http://www.roblox.com/Thumbs/Asset.ashx?width=420&height=420&assetId=" .. (tex[deb[block.Name]] or "75880927")
  5013. p.BGui.ImageLabel.ImageRectOffset = Vector2.new(math.random(0,360),math.random(0,360))
  5014. local r= math.random()
  5015. p.BGui.Size = UDim2.new(0.3 + r*.1,0,0.3 + r*.1,0)
  5016. p.Parent = workspace.CurrentCamera
  5017.  
  5018. p.CollisionGroupId = S_ReS.PhyGroups.Particles.Value
  5019. game.Debris:AddItem(p,math.random()*2)
  5020. end
  5021. end
  5022. if breakTimer <= 0 then
  5023. --destroyBlock(breaking.X,breaking.Y,breaking.Z)
  5024. --breakTimer = .5
  5025. --print("Timer Now:",breakTimer)
  5026. --breaking = nil
  5027. coroutine.resume(coroutine.create(function() S_ReS.GameRemotes.AcceptBreakBlock:InvokeServer() end))
  5028. end
  5029. end
  5030. end
  5031. end
  5032. if block then
  5033. sbox.Adornee = block
  5034. else
  5035. sbox.Adornee = nil
  5036. end
  5037. else
  5038. if breaking then
  5039. cancelBlock()
  5040. end
  5041. tarBlock = nil
  5042. sbox.Adornee = nil
  5043. end
  5044.  
  5045. end
  5046.  
  5047. lastBreaking = breaking
  5048.  
  5049. end)
  5050.  
  5051. local frozen = false
  5052.  
  5053. S_RS:BindToRenderStep("rloop",Enum.RenderPriority.Camera.Value + 1,function(dt) -- quick updates to humanoid, etc.
  5054. if char and char:FindFirstChild("HumanoidRootPart") then
  5055. local htorso = char.HumanoidRootPart
  5056. local pos = htorso.Position
  5057. local cx,cy = math.floor(pos.X/16/blocksize),math.floor(pos.Z/16/blocksize)
  5058. if not getChunk(cx,cy) then
  5059. if not frozen then
  5060. htorso.Anchored = true
  5061. frozen = true
  5062. end
  5063. elseif frozen then
  5064. frozen = false
  5065. htorso.Anchored = false
  5066. end
  5067. end
  5068. end)
  5069.  
  5070. ----- Inputs
  5071.  
  5072. function sprint(aName,state)
  5073. if char and char:FindFirstChild("Humanoid") then
  5074. if S_UIS.TouchEnabled then
  5075. if state == Enum.UserInputState.Begin then
  5076. if sprinting then
  5077. sprinting = false
  5078. char.Humanoid.WalkSpeed = 13
  5079. else
  5080. sprinting = true
  5081. char.Humanoid.WalkSpeed = 16.83
  5082. end
  5083. end
  5084. else
  5085. if state == Enum.UserInputState.Begin then
  5086. sprinting = true
  5087. char.Humanoid.WalkSpeed = 16.83
  5088. elseif state == Enum.UserInputState.End then
  5089. sprinting = false
  5090. char.Humanoid.WalkSpeed = 13
  5091. end
  5092. end
  5093. end
  5094. end
  5095.  
  5096. function dropItem(aName,state)
  5097. if state == Enum.UserInputState.Begin then
  5098. game.ReplicatedStorage.GameRemotes.DropItem:InvokeServer()
  5099. end
  5100. end
  5101. function attemptUse()
  5102. if tarBlock then
  5103. bob_attack = 10
  5104. local bl,ch = getBlock(PtoT(tarBlock.Position))
  5105. if bl and bl.name then
  5106. if bl.name == "CraftingTable" then
  5107. tarUsedBlock = Vector3.new(PtoT(tarBlock.Position))
  5108. openInv("CraftingTable")
  5109. return true
  5110. elseif bl.name == "Chest" then
  5111. tarUsedBlock = Vector3.new(PtoT(tarBlock.Position))
  5112. openInv("Chest")
  5113. return true
  5114. elseif bl.name == "Furnace" then
  5115. tarUsedBlock = Vector3.new(PtoT(tarBlock.Position))
  5116. openInv("Furnace")
  5117. return true
  5118. end
  5119. end
  5120. end
  5121. end
  5122. function attemptPlace()
  5123. bob_attack = 10
  5124. if tarBlock then
  5125. local tab = S_H:JSONDecode(selSlotV.Value)
  5126. local iname = tab.name
  5127. local item = iname and M_II[iname]
  5128.  
  5129. local block = item and item.block
  5130. if block or (item and item.placeable) then
  5131. local binfo = M_BI[iname]
  5132. local x,y,z = PtoT(tarBlock.Position + (tarDir*blocksize))
  5133. placeBlock(x,y,z,selSlot,tarDir,binfo and binfo.blocktype and (binfo.blocktype == "nonsolid"))
  5134. end
  5135. end
  5136. end
  5137. function attemptAttack()
  5138. bob_attack = 10
  5139. if tarPlayer then
  5140. game.ReplicatedStorage.GameRemotes.Attack:InvokeServer(tarPlayer)
  5141. return true
  5142. end
  5143. end
  5144. function attemptBreak(state)
  5145. abreak = state
  5146. if state then
  5147. bob_attack = 10
  5148. if tarBlock then
  5149. breakBlock(PtoT(tarBlock.Position))
  5150. return true
  5151. end
  5152. elseif breaking then
  5153. cancelBlock()
  5154. return true
  5155. end
  5156. end
  5157.  
  5158. function primary()
  5159. if not attemptAttack() then attemptBreak(true) end
  5160. end
  5161. function primaryRelease()
  5162. attemptBreak(false)
  5163. end
  5164. function secondary()
  5165. if not attemptUse() then attemptPlace() end
  5166. end
  5167.  
  5168.  
  5169. function onInput(input,state)
  5170. if state then
  5171. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  5172. primary()
  5173. elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
  5174. secondary()
  5175. elseif input.UserInputType == Enum.UserInputType.Keyboard then
  5176. --if input.KeyCode == Enum.KeyCode.LeftControl then
  5177. -- sprint(state)
  5178. --elseif input.KeyCode == Enum.KeyCode.E then
  5179. --toggleInv()
  5180. --else
  5181. local tS = {
  5182. "One","Two","Three","Four","Five","Six","Seven","Eight","Nine"
  5183. }
  5184. local tSR = {}
  5185. for i,v in pairs(tS) do
  5186. tSR[v] = i
  5187. end
  5188. local num = tSR[input.KeyCode.Name]
  5189. if num then
  5190. if (num >= 1) and (num < 10) then
  5191. setSelSlot(num - 1)
  5192. end
  5193. end
  5194. --end
  5195. end
  5196. elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
  5197. primaryRelease()
  5198. --elseif input.UserInputType == Enum.UserInputType.Keyboard then
  5199. --if input.KeyCode == Enum.KeyCode.LeftControl then
  5200. -- sprint(state)
  5201. --end
  5202. end
  5203. end
  5204.  
  5205. S_CAS:BindAction("dropItem",dropItem,false,Enum.KeyCode.Q)
  5206.  
  5207. S_CAS:BindAction("toggleInv",toggleInv,true,Enum.KeyCode.E)
  5208. S_CAS:SetImage("toggleInv","rbxassetid://3164650906")
  5209. S_CAS:SetDescription("toggleInv","Toggle inventory")
  5210. S_CAS:SetPosition("toggleInv",UDim2.new(0.3,0,0,0))
  5211.  
  5212. S_CAS:BindAction("sprint",sprint,true,Enum.KeyCode.LeftControl)
  5213. S_CAS:SetTitle("sprint","Sprint")
  5214. S_CAS:SetPosition("sprint",UDim2.new(0.6,0,0,0))
  5215.  
  5216. S_UIS.TouchTap:Connect(function(tpos,gp)
  5217. if not gp then
  5218. if not attemptAttack() then attemptPlace() end
  5219. end
  5220. end)
  5221. S_UIS.TouchLongPress:Connect(function(tpos,state,gp)
  5222. if not gp then
  5223. if state == Enum.UserInputState.Begin then
  5224. attemptBreak(true)
  5225. elseif state == Enum.UserInputState.End then
  5226. attemptBreak(false)
  5227. end
  5228. end
  5229. end)
  5230. S_UIS.InputBegan:Connect(function(input,gp)
  5231. if not gp then
  5232. onInput(input,true)
  5233. end
  5234. end)
  5235. S_UIS.InputEnded:Connect(function(input,gp)
  5236. --if not gp then
  5237. onInput(input,false)
  5238. --end
  5239. end)
  5240. S_UIS.InputChanged:Connect(function(input)
  5241. if input.UserInputType == Enum.UserInputType.MouseMovement then
  5242. elseif input.UserInputType == Enum.UserInputType.MouseWheel then
  5243. changeSelSlot(-input.Position.Z)
  5244. end
  5245. end)
  5246.  
  5247. ----- Load up / Additional things
  5248.  
  5249. local isFalling2 = false
  5250. local isFalling = false
  5251. local fallDist = 0
  5252. local lastY = 0
  5253.  
  5254. local isLoading = false
  5255.  
  5256. function reload()
  5257. print("- Reloading character... -")
  5258.  
  5259. local function sep(f)
  5260. spawn(function() pcall(f) end)
  5261. end
  5262.  
  5263. -- Reset Vari
  5264.  
  5265. isFalling2 = false
  5266. isFalling = false
  5267. fallDist = 0
  5268. lastY = 0
  5269.  
  5270. E_cVel = Vector3.new()
  5271.  
  5272. if hand then hand:Destroy() end
  5273.  
  5274. local sss = 0
  5275. local eee = 0
  5276. for _,v in pairs(chCons) do
  5277. local ok,msg = pcall(v.Disconnect,v)
  5278. if ok then
  5279. sss = sss + 1
  5280. else
  5281. eee = eee + 1
  5282. end
  5283. end
  5284. chCons = {}
  5285. print("Successfully disconnected",sss,"signal connections")
  5286.  
  5287. -- lgui
  5288.  
  5289. local lgui = p_gui:WaitForChild("LoadingGui",2)
  5290.  
  5291. -- set char anchor
  5292. local htorso = char:WaitForChild("HumanoidRootPart")
  5293. char.HumanoidRootPart.CFrame = CFrame.new(0,60*blocksize,0)
  5294. htorso.Anchored = true
  5295.  
  5296. -- Wait for inventory
  5297. sep(function()
  5298. lgui.Label1.Text = "Loading inventory.."
  5299. lgui.Label1Shadow.Text = "Loading inventory.."
  5300. end)
  5301. s_inv = char:WaitForChild("Inventory")
  5302. while #s_inv:GetChildren() < 45 do
  5303. local c = math.clamp(#s_inv:GetChildren()/36,0,1)
  5304. lgui.LBar.Bar.Size = UDim2.new(c,0,1,0)
  5305. wait()
  5306. end
  5307. print("Inventory has been updated")
  5308.  
  5309. -- Vari
  5310. local human = char:WaitForChild("Humanoid")
  5311.  
  5312. -- Link health
  5313. sep(function()
  5314. lgui.Label1.Text = "Loading HUD.."
  5315. lgui.Label1Shadow.Text = "Loading HUD.."
  5316. end)
  5317. linkHealth(human)
  5318.  
  5319. -- Load inventory
  5320. loadInventory()
  5321. setSelSlot(0)
  5322. print("Loaded inventory hud")
  5323.  
  5324. -- Load chunks first
  5325. -- lgui.Label1.Text = "Loading chunks first.."
  5326. -- lgui.Label1Shadow.Text = "Loading chunks first.."
  5327. -- lgui.LBar.Bar.Size = UDim2.new(0,3,1,0)
  5328. -- loadServerChunk(0,0)
  5329. -- lgui.LBar.Bar.Size = UDim2.new(.25,0,1,0)
  5330. -- loadServerChunk(-1,0)
  5331. -- lgui.LBar.Bar.Size = UDim2.new(.5,0,1,0)
  5332. -- loadServerChunk(0,-1)
  5333. -- lgui.LBar.Bar.Size = UDim2.new(.75,0,1,0)
  5334. -- loadServerChunk(-1,-1)
  5335. -- --generateChunk()
  5336. -- --generateChunk(-1,0)
  5337. -- --generateChunk(0,-1)
  5338. -- --generateChunk(-1,-1)
  5339. -- print("Loaded chunks first")
  5340.  
  5341. -- Misc
  5342. human:SetStateEnabled(Enum.HumanoidStateType.Climbing,false)
  5343. human.MaxSlopeAngle = 1
  5344. human.StateChanged:Connect(function(old,new)
  5345. --print(old,">>>",new)
  5346. if (new == Enum.HumanoidStateType.Running)
  5347. or (new == Enum.HumanoidStateType.RunningNoPhysics)
  5348. or (new == Enum.HumanoidStateType.Landed)
  5349. or (new == Enum.HumanoidStateType.StrafingNoPhysics) then
  5350. grounded = true
  5351. if new == Enum.HumanoidStateType.Landed then
  5352. local pos = htorso.Position + Vector3.new(0,-3 - blocksize/2,0)
  5353. local bl,ch = getBlock(PtoT(pos.X,pos.Y,pos.Z))
  5354. if bl and bl.name then
  5355. local bi = M_BI[bl.name]
  5356. if bi then
  5357. --print("Footstep")
  5358. local mat = materialsounds[bi.material or "default"] or materialsounds["default"]
  5359. playSound(htorso.Position + Vector3.new(0,-3,0),mat,1.3,.8)
  5360. end
  5361. end
  5362. end
  5363. else
  5364. grounded = false
  5365. end
  5366.  
  5367. if new == Enum.HumanoidStateType.Freefall then
  5368. isFalling = true
  5369. fallDist = 0
  5370. lastY = char.HumanoidRootPart.Position.Y
  5371. elseif old == Enum.HumanoidStateType.Freefall then
  5372. isFalling = false
  5373. end
  5374. end)
  5375.  
  5376. spawn(function()
  5377. char:WaitForChild("Sound"):WaitForChild("LocalSound").Disabled = true
  5378. print("Disabled local default sounds")
  5379. end)
  5380.  
  5381. -- Tp to land
  5382.  
  5383. sep(function()
  5384. lgui.LBar.Visible = false
  5385. lgui.Label1.Text = "Waiting for chunks.."
  5386. lgui.Label1Shadow.Text = "Waiting for chunks.."
  5387. end)
  5388. local spposv = game.ReplicatedStorage.PlayerPositionSaves:FindFirstChild(tostring(plr.UserId))
  5389. local sppos = spposv and spposv.Value
  5390. local wpos = S_ReS.WorldSpawn.Value
  5391. if sppos then
  5392. htorso.Anchored = false
  5393. htorso.CFrame = CFrame.new(sppos.X,sppos.Y,sppos.Z)
  5394. else
  5395. htorso.CFrame = CFrame.new(wpos.X,60*blocksize,wpos.Z)
  5396. local vp,vp2 = workspace:FindPartOnRayWithWhitelist(Ray.new(htorso.Position,Vector3.new(0,-255*blocksize)),{vblocks})
  5397. if not vp then repeat wait() htorso.CFrame = CFrame.new(wpos.X,255*blocksize,wpos.Z) vp,vp2 = workspace:FindPartOnRayWithWhitelist(Ray.new(htorso.Position,Vector3.new(0,-255*blocksize,0)),{vblocks}) until vp end
  5398. htorso.Anchored = false
  5399. htorso.CFrame = CFrame.new(vp2 + Vector3.new(0,blocksize*2,0))
  5400. end
  5401. game.ReplicatedStorage.GameRemotes.StartRecordingPos:FireServer()
  5402.  
  5403. isFalling = false
  5404. isFalling2 = false
  5405. fallDist = 0
  5406.  
  5407. -- Remove loading gui
  5408. sep(function()
  5409. if lgui then workspace.CurrentCamera.FieldOfView = 54 lgui:Destroy() end
  5410. end)
  5411.  
  5412. print("Character is successfully loaded")
  5413. end
  5414.  
  5415. plr.CharacterAdded:Connect(function(ch)
  5416. char=ch
  5417.  
  5418. reload()
  5419. end)
  5420. spawn(reload)
  5421.  
  5422. game.ReplicatedStorage.GameRemotes.ServerChat.OnClientEvent:Connect(function(msg)
  5423. -- game.StarterGui:SetCore("ChatMakeSystemMessage", {
  5424. -- Text = msg["Text"]; -- Required. Has to be a string!
  5425. -- Color = msg[2] or Color3.new(0, 1, 0); -- Cyan is (0, 255 / 255, 255 / 255). Optional, defaults to white: Color3.new(255 / 255, 255 / 255, 243 / 255)
  5426. -- Font = msg[3] or Enum.Font.SourceSansBold; -- Optional, defaults to Enum.Font.SourceSansBold
  5427. -- FontSize = Enum.FontSize.Size32; -- Optional, defaults to Enum.FontSize.Size18
  5428. -- })
  5429. game.StarterGui:SetCore("ChatMakeSystemMessage", msg)
  5430. --for i=1,5 do
  5431. -- wait(0.05)
  5432. --script.Beep:Play()
  5433. --end
  5434. end)
  5435.  
  5436. ----- The Loop
  5437.  
  5438. function mLoop(dt)
  5439. if char and char.Parent and char:FindFirstChild("HumanoidRootPart") then
  5440. local human = char.Humanoid
  5441. local htorso = char.HumanoidRootPart
  5442.  
  5443. for _,v in pairs(char:GetChildren()) do
  5444. if v:IsA("BasePart") then
  5445. v.Massless = v.Name ~= "HumanoidRootPart"
  5446. end
  5447. end
  5448.  
  5449.  
  5450. -- htorso.Anchored = true
  5451. local pos = htorso.Position
  5452. local bl,ch = getBlock(PtoT(pos.X,pos.Y-2,pos.Z))
  5453. local exist = bl and bl.name
  5454.  
  5455. local bf = htorso:FindFirstChild("Grav")
  5456. if not bf then
  5457. bf = Instance.new("BodyForce")
  5458. bf.Name = "Grav"
  5459. bf.Force = Vector3.new()
  5460. bf.Parent = htorso
  5461. end
  5462. local bv = htorso:FindFirstChild("Swim")
  5463. if not bv then
  5464. bv = Instance.new("BodyVelocity")
  5465. bv.Name = "Swim"
  5466. bv.Velocity = Vector3.new()
  5467. bv.MaxForce = Vector3.new()
  5468. bv.Parent = htorso
  5469. end
  5470. --
  5471. -- local gravity = Vector3.new(0,-workspace.Gravity*dt*dt,0)
  5472.  
  5473. -- local function rep()
  5474. -- local apos = htorso.Position + E_cVel*dt
  5475. -- local a,b,c = PtoT(apos.X,apos.Y - (E_size.Y/2*blocksize),apos.Z)
  5476. -- local bl,ch = getBlock(a,b,c)
  5477. -- local exist = bl and bl.name
  5478. --
  5479. -- if exist then
  5480. -- --print(exist,"ground")
  5481. -- ground = true
  5482. -- --print((b*blocksize))
  5483. -- --print((b*blocksize)+(blocksize/2) + (E_size.Y/2*blocksize),apos.Y)
  5484. -- local b = (b*blocksize)+(blocksize/2) + (E_size.Y/2*blocksize)
  5485. -- --print(b,E_cVel.Y,apos.Y)
  5486. -- local aa = (apos.Y-b)
  5487. -- E_cVel = Vector3.new(E_cVel.X,E_cVel.Y - aa,E_cVel.Z)
  5488. -- else
  5489. -- ground = false
  5490. -- end
  5491. -- htorso.CFrame = htorso.CFrame + (E_cVel)
  5492. -- htorso.Velocity = E_cVel
  5493. -- end
  5494. --
  5495. -- print(E_cVel)
  5496. --
  5497. local vel = htorso.Velocity
  5498. if exist == "Lava" then
  5499. inWater = false
  5500. bf.Force = Vector3.new(0,workspace.Gravity*0.75,0)
  5501. if human.Jump then
  5502. bv.Velocity = Vector3.new(0,3,0)
  5503. bv.MaxForce = Vector3.new(0,280,0)
  5504. bv.P = 7500
  5505. else
  5506. bv.MaxForce = Vector3.new(0,0,0)
  5507. end
  5508. htorso.Velocity = vel*0.5
  5509. elseif exist == "Water" then
  5510. inWater = true
  5511. bf.Force = Vector3.new(0,workspace.Gravity*0.75,0)
  5512. if human.Jump then
  5513. bv.Velocity = Vector3.new(0,3,0)
  5514. bv.MaxForce = Vector3.new(0,280,0)
  5515. bv.P = 7500
  5516. else
  5517. bv.MaxForce = Vector3.new(0,0,0)
  5518. end
  5519. htorso.Velocity = vel*0.8
  5520. else
  5521. inWater = false
  5522. bv.Velocity = Vector3.new()
  5523. bv.MaxForce = Vector3.new()
  5524. bf.Force = Vector3.new()
  5525. --htorso.Velocity = Vector3.new(vel.X*0.6,vel.Y*0.98,vel.Z*0.6)
  5526. end
  5527.  
  5528. if (voidtimer <= 0) and (htorso.Position.Y <= (-64*blocksize)) then
  5529. reqDamage(20,"void")
  5530. --S_ReS.GameRemotes.RequestDamage:FireServer(20,"void")
  5531. voidtimer = 0.5
  5532. end
  5533. if isFalling and (not inWater) then
  5534. isFalling2 = true
  5535. local change = char.HumanoidRootPart.Position.Y - lastY
  5536. lastY = char.HumanoidRootPart.Position.Y
  5537.  
  5538. if change < 0 then
  5539. fallDist = fallDist - change
  5540. end
  5541. elseif isFalling2 then
  5542. isFalling2 = false
  5543.  
  5544. local change = char.HumanoidRootPart.Position.Y - lastY
  5545. lastY = char.HumanoidRootPart.Position.Y
  5546.  
  5547. if change < 0 then
  5548. fallDist = fallDist - change
  5549. end
  5550.  
  5551. -- print("Math time!")
  5552. -- print(fallDist)
  5553. -- print(fallDist/blocksize)
  5554. -- print(fallDist/blocksize - 3)
  5555. -- print(math.max(0,(fallDist/blocksize)-3))
  5556. -- print(math.max(0,(fallDist/blocksize)-3)*5)
  5557. if not inWater then
  5558. local fdmg = math.max(0,((fallDist/blocksize)+.1)-3)*5
  5559. if fdmg >= 5 then
  5560. reqDamage(fdmg,"fall")
  5561. --S_ReS.GameRemotes.RequestDamage:FireServer(fdmg,"fall")
  5562. --char.Humanoid:TakeDamage(fdmg)
  5563. end
  5564. end
  5565. fallDist = 0
  5566. end
  5567. end
  5568. end
  5569.  
  5570. S_RS:BindToRenderStep("mloop",Enum.RenderPriority.Camera.Value + 1,mLoop)
  5571.  
  5572. game.ReplicatedStorage.GameRemotes.BeingAttacked.OnClientEvent:Connect(function(dir)
  5573. for _,v in pairs(char:GetChildren()) do
  5574. if v:IsA("BasePart") then
  5575. v.Velocity = v.Velocity + (CFrame.new(Vector3.new(),Vector3.new(dir.X,0,dir.Z)) * CFrame.new(0,7 / (1 + math.max(0,v.Velocity.Y/4)),-4)).Position
  5576. end
  5577. end
  5578. end)
  5579.  
  5580. game:GetService("ScriptContext").Error:Connect(function(message)
  5581. if message == "not enough memory" then
  5582. plr:Kick("Not enough memory, please reconnect")
  5583. end
  5584. end)
  5585.  
  5586. --spawn(function()
  5587. while wait() do
  5588. local dist = 3
  5589. local nearestCC = nil
  5590. local ccpos = workspace.CurrentCamera.CFrame.Position
  5591. local cpos = Vector2.new(math.floor(ccpos.X/16/blocksize),math.floor(ccpos.Z/16/blocksize))
  5592. for x=-3,3 do
  5593. for y=-3,3 do
  5594. local pos2 = Vector2.new(x+cpos.X,y+cpos.Y)
  5595. local dist2 = (pos2 - cpos).Magnitude
  5596. if (dist2 < dist) then-- and (math.random()^0.5 < (dist2/2.5))
  5597. local chunk = getChunk(pos2.X,pos2.Y)
  5598.  
  5599. if (not chunk) and (not (loadingChunks[x] and loadingChunks[x][y])) then
  5600. --spawn(function() loadServerChunk(pos2.X,pos2.Y) end)
  5601. nearestCC = pos2
  5602. dist = dist2
  5603. end
  5604. end
  5605. end
  5606. end
  5607. if nearestCC then
  5608. --spawn(function() generateChunk(nearestCC.X,nearestCC.Y) end)
  5609. spawn(function() loadServerChunk(nearestCC.X,nearestCC.Y) end)
  5610. end
  5611.  
  5612. local dist = viewdist
  5613. local farCC = nil
  5614. local farpos = nil
  5615. local ccpos = workspace.CurrentCamera.CFrame.Position
  5616. local cpos = Vector2.new(math.floor(ccpos.X/16/blocksize),math.floor(ccpos.Z/16/blocksize))
  5617.  
  5618. for xx,cx in pairs(world) do
  5619. for yy,ch in pairs(cx) do
  5620. local pos2 = Vector2.new(xx,yy)
  5621. local dist2 = (pos2 - cpos).Magnitude
  5622. if dist2 > dist then
  5623. dist = dist2
  5624. farpos = pos2
  5625. farCC = ch
  5626. end
  5627. end
  5628. end
  5629.  
  5630. if farCC then
  5631. farCC.vlfold:Destroy()
  5632. farCC.vfold:Destroy()
  5633. --local chu = world[farpos.X][farpos.Y]
  5634. world[farpos.X][farpos.Y] = nil
  5635. end
  5636. end
  5637. --end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement