Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- ModuleScript0 = Instance.new("ModuleScript")
- ModuleScript1 = Instance.new("ModuleScript")
- ModuleScript0.Name = "MouseModule"
- ModuleScript0.Parent = mas
- table.insert(cors,sandbox(ModuleScript0,function()
- -- Mouse
- -- Crazyman32
- -- April 28, 2015
- --[[
- Usage:
- local mouse = require(thisModule).new()
- METHODS:
- <Vector2 position, Vector2 delta> mouse:GetPosition()
- <Boolean isDown> mouse:IsDown(UserInputType button)
- <CFrame cframe, Object target, Vector3 normal> mouse:ProjectMouseRay(table ignoreList)
- EVENTS:
- mouse.ButtonDown(UserInputType button)
- mouse.ButtonUp(UserInputType button)
- mouse.Moved(Vector2 position, Vector2 deltaPosition)
- mouse.Scrolled(Integer delta)
- --]]
- local Mouse = {}
- Mouse.__index = Mouse
- function Mouse.new()
- local player = game.Players.LocalPlayer
- assert(player, "Could not get player")
- local cam = game.Workspace.CurrentCamera
- local Ray = Ray.new
- local input = game:GetService("UserInputService")
- local button1 = Enum.UserInputType.MouseButton1
- local button2 = Enum.UserInputType.MouseButton2
- local button3 = Enum.UserInputType.MouseButton3
- local mouseMovement = Enum.UserInputType.MouseMovement
- local mouseWheel = Enum.UserInputType.MouseWheel
- local mouse = {}
- local mousePos, mouseDelta = Vector2.new(workspace.CurrentCamera.ViewportSize.X/2,workspace.CurrentCamera.ViewportSize.Y/2 - 36), Vector2.new()
- local clicking = {
- [button1] = false;
- [button2] = false;
- [button3] = false;
- }
- local function CreateEvent(eventName)
- local e = Instance.new("BindableEvent")
- mouse[eventName] = e.Event
- return function(...)
- e:Fire(...)
- end
- end
- -- Events ---------------------------------------------------------------
- local buttonDown = CreateEvent("ButtonDown")
- local buttonUp = CreateEvent("ButtonUp")
- local moved = CreateEvent("Moved")
- local scrolled = CreateEvent("Scrolled")
- -------------------------------------------------------------------------
- -- API ------------------------------------------------------------------
- function mouse:IsDown(inputType)
- return (clicking[inputType] == true)
- end
- function mouse:GetPosition()
- return mousePos, mouseDelta
- end
- function mouse:ProjectMouseRay(ignoreList)
- ignoreList = ignoreList or {}
- local pos = self:GetPosition()
- local ray = cam:ScreenPointToRay(pos.X, pos.Y, 0)
- ray = Ray(ray.Origin, (ray.Unit.Direction * 999))
- local hit, hitPos, normal = game.Workspace:FindPartOnRayWithIgnoreList(ray, ignoreList or {}, true, false)
- local cframe = CFrame.new(hitPos, (hitPos + ray.Unit.Direction))
- if (hit) and (hit.Transparency >= 1) then
- table.insert(ignoreList,hit)
- return mouse:ProjectMouseRay(ignoreList)
- elseif (hit) and (not hit.CanCollide) then
- table.insert(ignoreList,hit)
- return mouse:ProjectMouseRay(ignoreList)
- elseif (hit) and (hit:FindFirstAncestorOfClass("Tool")) then
- table.insert(ignoreList,hit)
- return mouse:ProjectMouseRay(ignoreList)
- else
- return cframe, hit, normal
- end
- end
- function mouse:ProjectMouseRay2(whiteList)
- local pos = self:GetPosition()
- local ray = cam:ScreenPointToRay(pos.X, pos.Y, 0)
- ray = Ray(ray.Origin, (ray.Unit.Direction * 999))
- local hit, hitPos, normal = game.Workspace:FindPartOnRayWithWhitelist(ray, whiteList or {}, true, false)
- local cframe = CFrame.new(hitPos, (hitPos + ray.Unit.Direction))
- return cframe, hit, normal
- end
- -------------------------------------------------------------------------
- -- UserInputService Setup -----------------------------------------------
- local function InputBegan(inputObject, gameProcessed)
- if (gameProcessed) then return end
- local inputType = inputObject.UserInputType
- if (inputType == button1 or inputType == button2 or inputType == button3) then
- clicking[inputType] = true
- buttonDown(inputType)
- end
- end
- local function InputChanged(inputObject, gameProcessed)
- --if (gameProcessed) then return end
- local inputType = inputObject.UserInputType
- if (inputType == mouseMovement) then
- local newMousePos = Vector2.new(inputObject.Position.X, inputObject.Position.Y)
- local delta = newMousePos - mousePos
- mousePos = newMousePos
- mouseDelta = Vector2.new(delta.X, delta.Y)
- moved(mousePos, mouseDelta)
- elseif (inputType == mouseWheel) then
- local num = inputObject.Position.Z
- scrolled(num < 0 and -1 or num > 0 and 1 or 0)
- end
- end
- local function InputEnded(inputObject, gameProcessed)
- --if (gameProcessed) then return end
- local inputType = inputObject.UserInputType
- if (inputType == button1 or inputType == button2 or inputType == button3) then
- clicking[inputType] = false
- buttonUp(inputType)
- end
- end
- input.InputBegan:connect(InputBegan)
- input.InputChanged:connect(InputChanged)
- input.InputEnded:connect(InputEnded)
- -------------------------------------------------------------------------
- return setmetatable(mouse, Mouse)
- end
- function Mouse:__tostring()
- local pos = self:GetPosition()
- return ("Mouse <" .. tostring(pos) .. ">")
- end
- return Mouse
- end))
- ModuleScript1.Name = "FontModule"
- ModuleScript1.Parent = mas
- table.insert(cors,sandbox(ModuleScript1,function()
- local ft = {}
- local scale = 2
- local defaultfsp = 5
- local fontsizes = {
- }
- local ftex = script.Parent:WaitForChild("Font")
- function ft.linkLabel(label)
- label.TextTransparency = 1
- label.TextStrokeTransparency = 1
- label:GetPropertyChangedSignal("Text"):Connect(function()
- label.TextTransparency = 1
- label.TextStrokeTransparency = 1
- label:ClearAllChildren()
- local len = label.Text:len()
- if len > 0 then
- for i=1,len do
- local let = label.Text:sub(i,i)
- local cf = ftex:FindFirstChild(let)
- if cf then
- local cf = cf:Clone()
- cf.Size = UDim2.new(0,16,0,16)
- cf.Position = UDim2.new(1,-defaultfsp*2 - (defaultfsp*scale + scale) * (len - i),1,-16)
- for _,v in pairs(cf:GetChildren()) do
- if v:IsA("Frame") then
- v.BackgroundColor3 = label.TextColor3
- end
- end
- cf.Parent = label
- end
- end
- end
- end)
- end
- return ft
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = script
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Folder0 = Instance.new("Folder")
- ModuleScript1 = Instance.new("ModuleScript")
- ModuleScript2 = Instance.new("ModuleScript")
- ModuleScript3 = Instance.new("ModuleScript")
- ModuleScript4 = Instance.new("ModuleScript")
- ModuleScript5 = Instance.new("ModuleScript")
- ModuleScript6 = Instance.new("ModuleScript")
- ModuleScript7 = Instance.new("ModuleScript")
- ModuleScript8 = Instance.new("ModuleScript")
- Folder9 = Instance.new("Folder")
- Sound10 = Instance.new("Sound")
- Sound11 = Instance.new("Sound")
- Sound12 = Instance.new("Sound")
- Sound13 = Instance.new("Sound")
- Sound14 = Instance.new("Sound")
- Sound15 = Instance.new("Sound")
- Sound16 = Instance.new("Sound")
- Sound17 = Instance.new("Sound")
- Sound18 = Instance.new("Sound")
- Sound19 = Instance.new("Sound")
- Sky20 = Instance.new("Sky")
- Folder21 = Instance.new("Folder")
- RemoteFunction22 = Instance.new("RemoteFunction")
- RemoteFunction23 = Instance.new("RemoteFunction")
- RemoteEvent24 = Instance.new("RemoteEvent")
- RemoteEvent25 = Instance.new("RemoteEvent")
- RemoteEvent26 = Instance.new("RemoteEvent")
- RemoteEvent27 = Instance.new("RemoteEvent")
- RemoteFunction28 = Instance.new("RemoteFunction")
- RemoteFunction29 = Instance.new("RemoteFunction")
- RemoteFunction30 = Instance.new("RemoteFunction")
- RemoteFunction31 = Instance.new("RemoteFunction")
- RemoteFunction32 = Instance.new("RemoteFunction")
- RemoteFunction33 = Instance.new("RemoteFunction")
- RemoteEvent34 = Instance.new("RemoteEvent")
- RemoteEvent35 = Instance.new("RemoteEvent")
- RemoteFunction36 = Instance.new("RemoteFunction")
- RemoteFunction37 = Instance.new("RemoteFunction")
- RemoteEvent38 = Instance.new("RemoteEvent")
- Folder39 = Instance.new("Folder")
- IntValue40 = Instance.new("IntValue")
- IntValue41 = Instance.new("IntValue")
- IntValue42 = Instance.new("IntValue")
- Folder43 = Instance.new("Folder")
- Folder44 = Instance.new("Folder")
- RemoteFunction45 = Instance.new("RemoteFunction")
- RemoteEvent46 = Instance.new("RemoteEvent")
- RemoteEvent47 = Instance.new("RemoteEvent")
- RemoteEvent48 = Instance.new("RemoteEvent")
- Vector3Value49 = Instance.new("Vector3Value")
- Folder0.Name = "AssetsMod"
- Folder0.Parent = mas
- ModuleScript1.Name = "Textures"
- ModuleScript1.Parent = Folder0
- table.insert(cors,sandbox(ModuleScript1,function()
- return {
- -- Blocks
- ["grasstop"] = 3131912045, -- Full grassy; Top texture of a grass block
- ["grassside"] = 3132023393, -- Dirt at bottom, some grass at top; Texture of sides of a grass block
- ["dirt"] = 3103457697, -- Full dirt; Bottom texture of a grass block
- ["stone"] = 3131912893, -- Full stone
- ["cobble"] = 3718806379,
- ["sand"] = 3725400827,
- ["bricks"] = 3479487392,
- ["glass"] = 3149393569, -- Transparent, often surrounded by white lines
- ["logside"] = 3149643651, -- Side of a log -- Known textures: 3595677229, 71445924
- ["logcut"] = 3149644490, -- Top/bottom of logs, similar to log texture
- ["planks"] = 3131912507, -- Fully planks
- ["leaves"] = 140507911, -- Fully leaves, semi-transparent
- ["coalblock"] = 150433747, -- Fully coal (dark color)
- ["ironblock"] = 59406020, -- Fully iron (platinum like color)
- ["diamondblock"] = 140574423, -- Fully diamond (cyan like color)
- ["obsidian"] = 3725380400, -- Fully obsidian
- ["bedrock"] = 3725398839, -- Darker texture of stone
- ["crafttop"] = 3725388039,
- ["craftside"] = 3725405589,
- ["craftfront"] = 3725408235,
- ["furnacetop"] = 3725389003, -- Top texture of the furnace, stone type
- ["furnaceside"] = 3725386392,
- ["furnace"] = 3725390238, -- Stone-type furnace, with 1 slot at bottom half and another one on top half with one output slot that shares space.
- ["litfurnace"] = 3725390238, -- Furnace with bottom half lit
- ["diamondore"] = 3479489943, -- Diamonds (cyan-like color) stuck in a stone
- ["ironore"] = 3479499952, -- Iron nuggets (platinum-like color) stuck in a stone
- ["coalore"] = 3479489080, -- Coal stuck in a stone
- -- Non-solids
- -- Liquid
- ["water"] = 204384984,
- ["water"] = 204384984,
- }
- end))
- ModuleScript2.Name = "Sounds"
- ModuleScript2.Parent = Folder0
- table.insert(cors,sandbox(ModuleScript2,function()
- return {
- -- hurt
- ["hurt1"] = 3362337129,
- ["hurt2"] = 3362346832,
- ["hurt3"] = 3362346832,
- }
- end))
- ModuleScript3.Name = "BlockInfo"
- ModuleScript3.Parent = Folder0
- table.insert(cors,sandbox(ModuleScript3,function()
- local defaultFP = {
- CFrame.new(0,0,0) * CFrame.Angles(0,-math.pi/2,0),
- CFrame.new(0,0,0) * CFrame.Angles(0,math.pi/2,0),
- CFrame.new(0,0,0) * CFrame.Angles(0,math.pi,0),
- CFrame.new(0,0,0) * CFrame.Angles(0,0,0)
- }
- return {
- Dirt = {
- hardness = .5,
- drop = "Dirt",
- hasItsOwnItem = true,
- material = "dirt",
- texture = "dirt"
- },
- GrassBlock = {
- hardness = .6,
- drop = "Dirt",
- hasItsOwnItem = "Grass Block",
- material = "grass",
- texture = {
- [Enum.NormalId.Top] = "grasstop",
- [Enum.NormalId.Front] = "grassside",
- [Enum.NormalId.Left] = "grassside",
- [Enum.NormalId.Right] = "grassside",
- [Enum.NormalId.Back] = "grassside",
- [Enum.NormalId.Bottom] = "dirt",
- }
- },
- Sand = {
- hardness = .5,
- drop = "Sand",
- hasItsOwnItem = true,
- material = "sand",
- texture = "sand",
- },
- Water = {
- hardness = 100,
- hasItsOwnItem = true,
- blocktype = "fluid",
- material = "water",
- texture = "water",
- customBlock = true,
- },
- Lava = {
- hardness = 100,
- hasItsOwnItem = true,
- blocktype = "fluid",
- material = "lava",
- texture = "lava",
- customBlock = true,
- },
- Bedrock = {
- hardness = 100000,
- hasItsOwnItem = true,
- material = "stone",
- texture = "bedrock"
- },
- Stone = {
- hardness = 1.5,
- drop = "Cobblestone",
- toolRequire = "pickaxe",
- hasItsOwnItem = true,
- material = "stone",
- texture = "stone"
- },
- Cobblestone = {
- hardness = 1.5,
- drop = "Cobblestone",
- toolRequire = "pickaxe",
- hasItsOwnItem = true,
- material = "stone",
- texture = "cobble"
- },
- Leaves = {
- hardness = .2,
- hasItsOwnItem = true,
- raredrop = {
- {1/20,"Stick"}
- },
- material = "leaves",
- texture = "leaves",
- customBlock = true,
- },
- OakLog = {
- hardness = 2,
- drop = "OakLog",
- hasItsOwnItem = "Log",
- betterTool = "axe",
- material = "wood",
- texture = {
- [Enum.NormalId.Top] = "logcut",
- [Enum.NormalId.Front] = "logside",
- [Enum.NormalId.Left] = "logside",
- [Enum.NormalId.Right] = "logside",
- [Enum.NormalId.Back] = "logside",
- [Enum.NormalId.Bottom] = "logcut",
- }
- },
- OakPlanks = {
- hardness = 2,
- drop = "OakPlanks",
- hasItsOwnItem = "Planks",
- betterTool = "axe",
- material = "wood",
- texture = "planks"
- },
- CraftingTable = {
- hardness = 2,
- drop = "CraftingTable",
- hasItsOwnItem = "Crafting Table",
- betterTool = "axe",
- material = "wood",
- texture = {
- [Enum.NormalId.Top] = "crafttop",
- [Enum.NormalId.Front] = "craftfront",
- [Enum.NormalId.Left] = "craftside",
- [Enum.NormalId.Right] = "craftside",
- [Enum.NormalId.Back] = "craftfront",
- [Enum.NormalId.Bottom] = "planks",
- },
- facingPos = defaultFP
- },
- Furnace = {
- hardness = 3.5,
- drop = "Furnace",
- hasItsOwnItem = "Furnace",
- toolRequire = "pickaxe",
- material = "stone",
- facingPos = defaultFP
- },
- Chest = {
- hardness = 2.5,
- drop = "Chest",
- hasItsOwnItem = true,
- betterTool = "axe",
- material = "wood",
- facingPos = defaultFP
- },
- Glass = {
- hardness = .3,
- hasItsOwnItem = true,
- material = "glass",
- texture = "glass",
- },
- Bricks = {
- hardness = 2,
- drop = "Bricks",
- toolRequire = "pickaxe",
- material = "stone",
- texture = "bricks",
- },
- CoalOre = {
- hardness = 3,
- drop = "Coal",
- toolRequire = "pickaxe",
- toolLevelRequire = "wooden",
- hasItsOwnItem = "Coal Ore",
- material = "stone",
- texture = "coalore"
- },
- IronOre = {
- hardness = 3,
- drop = "IronIngot",--"IronOre",
- toolRequire = "pickaxe",
- toolLevelRequire = "stone",
- hasItsOwnItem = "Iron Ore",
- material = "stone",
- texture = "ironore"
- },
- DiamondOre = {
- hardness = 3,
- drop = "Diamond",
- toolRequire = "pickaxe",
- toolLevelRequire = "iron",
- hasItsOwnItem = "Diamond Ore",
- material = "stone",
- texture = "diamondore"
- },
- CoalBlock = {
- id = 173,
- hardness = 5,
- drop = "CoalBlock",
- toolRequire = "pickaxe",
- hasItsOwnItem = true,
- material = "stone",
- texture = "coalblock"
- },
- IronBlock = {
- id = 42,
- hardness = 5,
- drop = "IronBlock",
- toolRequire = "pickaxe",
- toolLevelRequire = "stone",
- hasItsOwnItem = "Iron Block",
- material = "metal",
- texture = "ironblock"
- },
- DiamondBlock = {
- id = 57,
- hardness = 5,
- drop = "DiamondBlock",
- toolRequire = "pickaxe",
- toolLevelRequire = "iron",
- hasItsOwnItem = "Diamond Block",
- material = "metal",
- texture = "diamondblock"
- },
- Obsidian = {
- hardness = 50,
- drop = "Obsidian",
- toolRequire = "pickaxe",
- toolLevelRequire = "diamond",
- hasItsOwnItem = true,
- material = "stone",
- texture = "obsidian"
- },
- Torch = {
- hardness = 0,
- drop = "Torch",
- blocktype = "nonsolid",
- facingPos = {
- CFrame.new(-1.3,0,0) * CFrame.Angles(0,0,math.rad(-15)),
- CFrame.new(1.3,0,0) * CFrame.Angles(0,0,math.rad(15)),
- CFrame.new(0,0,-1.3) * CFrame.Angles(math.rad(15),0,0),
- CFrame.new(0,0,1.3) * CFrame.Angles(math.rad(-15),0,0),
- CFrame.new(0,-0.5675,0)
- },
- facingPosDef = 5,
- custom = "Torch",
- }
- }
- end))
- ModuleScript4.Name = "ItemInfo"
- ModuleScript4.Parent = Folder0
- table.insert(cors,sandbox(ModuleScript4,function()
- local M_BI = require(script.Parent:WaitForChild("BlockInfo"))
- local items = {
- Stick = {
- id = 280,
- maxstack = 64,
- texture = "stick"
- },
- Torch = {
- id = 50,
- maxstack = 64,
- texture = "torch",
- placeable = 1,
- },
- Coal = {
- id = 263,
- maxstack = 64,
- texture = "coal"
- },
- Diamond = {
- id = 264,
- maxstack = 64,
- texture = "diamond"
- },
- IronIngot = {
- id = 265,
- maxstack = 64,
- texture = "ironingot",
- name = "Iron Ingot"
- },
- Brick = {
- id = 336,
- maxstack = 64,
- texture = "missing",
- name = "Brick",
- },
- WoodenPickaxe = {
- id = 270,
- maxstack = 1,
- texture = "woodenpickaxe",
- level = "wooden",
- tooltype = "pickaxe",
- name = "Wooden Pickaxe"
- },
- StonePickaxe = {
- id = 274,
- maxstack = 1,
- texture = "stonepickaxe",
- level = "stone",
- tooltype = "pickaxe",
- name = "Stone Pickaxe"
- },
- IronPickaxe = {
- id = 257,
- maxstack = 1,
- texture = "ironpickaxe",
- level = "iron",
- tooltype = "pickaxe",
- name = "Iron Pickaxe"
- },
- DiamondPickaxe = {
- id = 278,
- maxstack = 1,
- texture = "diamondpickaxe",
- level = "diamond",
- tooltype = "pickaxe",
- name = "Diamond Pickaxe"
- },
- WoodenAxe = {
- id = 271,
- maxstack = 1,
- texture = "woodenaxe",
- level = "wooden",
- tooltype = "axe",
- name = "Wooden Axe"
- },
- StoneAxe = {
- id = 275,
- maxstack = 1,
- texture = "stoneaxe",
- level = "stone",
- tooltype = "axe",
- name = "Stone Axe"
- },
- IronAxe = {
- id = 258,
- maxstack = 1,
- texture = "ironaxe",
- level = "iron",
- tooltype = "axe",
- name = "Iron Axe"
- },
- DiamondAxe = {
- id = 279,
- maxstack = 1,
- texture = "diamondaxe",
- level = "diamond",
- tooltype = "axe",
- name = "Diamond Axe"
- },
- WoodenSword = {
- id = 268,
- maxstack = 1,
- texture = "woodensword",
- level = "wooden",
- tooltype = "sword",
- name = "Wooden Sword"
- },
- StoneSword = {
- id = 272,
- maxstack = 1,
- texture = "stonesword",
- level = "stone",
- tooltype = "sword",
- name = "Stone Sword"
- },
- IronSword = {
- id = 267,
- maxstack = 1,
- texture = "ironsword",
- level = "iron",
- tooltype = "sword",
- name = "Iron Sword"
- },
- DiamondSword = {
- id = 276,
- maxstack = 1,
- texture = "diamondsword",
- level = "diamond",
- tooltype = "sword",
- name = "Diamond Sword"
- },
- Item = {
- maxstack = 64
- },
- }
- for i,v in pairs(M_BI) do
- if v.hasItsOwnItem and not items[i] then
- local item = {
- maxstack = 64,
- defaultname = (type(v.hasItsOwnItem) == "string") and v.hasItsOwnItem or i,
- block = i
- }
- items[i] = item
- end
- end
- return items
- end))
- ModuleScript5.Name = "Recipes"
- ModuleScript5.Parent = Folder0
- table.insert(cors,sandbox(ModuleScript5,function()
- local recipes = {
- OakPlanks = {
- "OakLog",nil,nil,
- nil,nil,nil,
- nil,nil,nil,
- 4
- },
- CraftingTable = {
- "OakPlanks","OakPlanks",nil,
- "OakPlanks","OakPlanks",nil,
- nil,nil,nil
- },
- Furnace = {
- "Cobblestone","Cobblestone","Cobblestone",
- "Cobblestone",nil,"Cobblestone",
- "Cobblestone","Cobblestone","Cobblestone"
- },
- Chest = {
- "OakPlanks","OakPlanks","OakPlanks",
- "OakPlanks",nil,"OakPlanks",
- "OakPlanks","OakPlanks","OakPlanks"
- },
- Bricks = {
- "Brick","Brick",nil,
- "Brick","Brick",nil,
- nil,nil,nil
- },
- CoalBlock = {
- "Coal","Coal","Coal",
- "Coal","Coal","Coal",
- "Coal","Coal","Coal",
- },
- Coal = {
- "CoalBlock",nil,nil,
- nil,nil,nil,
- nil,nil,nil,
- 9
- },
- IronBlock = {
- "IronIngot","IronIngot","IronIngot",
- "IronIngot","IronIngot","IronIngot",
- "IronIngot","IronIngot","IronIngot"
- },
- IronIngot = {
- "IronBlock",nil,nil,
- nil,nil,nil,
- nil,nil,nil,
- 9
- },
- DiamondBlock = {
- "Diamond","Diamond","Diamond",
- "Diamond","Diamond","Diamond",
- "Diamond","Diamond","Diamond"
- },
- Diamond = {
- "DiamondBlock",nil,nil,
- nil,nil,nil,
- nil,nil,nil,
- 9
- },
- WoodenPickaxe = {
- "OakPlanks","OakPlanks","OakPlanks",
- nil,"Stick",nil,
- nil,"Stick",nil
- },
- StonePickaxe = {
- "Cobblestone","Cobblestone","Cobblestone",
- nil,"Stick",nil,
- nil,"Stick",nil
- },
- IronPickaxe = {
- "IronIngot","IronIngot","IronIngot",
- nil,"Stick",nil,
- nil,"Stick",nil
- },
- DiamondPickaxe = {
- "Diamond","Diamond","Diamond",
- nil,"Stick",nil,
- nil,"Stick",nil
- },
- WoodenAxe = {
- "OakPlanks","OakPlanks",nil,
- "OakPlanks","Stick",nil,
- nil,"Stick",nil
- }, WoodenAxe = {
- "OakPlanks","OakPlanks",nil,
- "Stick","OakPlanks",nil,
- "Stick",nil,nil
- },
- StoneAxe = {
- "Cobblestone","Cobblestone",nil,
- "Cobblestone","Stick",nil,
- nil,"Stick",nil
- }, StoneAxe = {
- "Cobblestone","Cobblestone",nil,
- "Stick","Cobblestone",nil,
- "Stick",nil,nil
- },
- IronAxe = {
- "IronIngot","IronIngot",nil,
- "IronIngot","Stick",nil,
- nil,"Stick",nil
- }, IronAxe = {
- "IronIngot","IronIngot",nil,
- "Stick","IronIngot",nil,
- "Stick",nil,nil
- },
- DiamondAxe = {
- "Diamond","Diamond",nil,
- "Diamond","Stick",nil,
- nil,"Stick",nil
- }, DiamondAxe = {
- "Diamond","Diamond",nil,
- "Stick","Diamond",nil,
- "Stick",nil,nil
- },
- WoodenSword = {
- "OakPlanks",nil,nil,
- "OakPlanks",nil,nil,
- "Stick",nil,nil
- },
- StoneSword = {
- "Cobblestone",nil,nil,
- "Cobblestone",nil,nil,
- "Stick",nil,nil
- },
- IronSword = {
- "IronIngot",nil,nil,
- "IronIngot",nil,nil,
- "Stick",nil,nil
- },
- DiamondSword = {
- "Diamond",nil,nil,
- "Diamond",nil,nil,
- "Stick",nil,nil
- },
- Stick = {
- "OakPlanks",nil,nil,
- "OakPlanks",nil,nil,
- nil,nil,nil,
- 4
- },
- Torch = {
- "Coal",nil,nil,
- "Stick",nil,nil,
- nil,nil,nil,
- 4
- },
- }
- local unorderedRecipes = {
- }
- return {recipes,unorderedRecipes}
- end))
- ModuleScript6.Name = "ItemLevels"
- ModuleScript6.Parent = Folder0
- table.insert(cors,sandbox(ModuleScript6,function()
- return {
- speedMul = {
- wooden = 2,
- golden = 12,
- stone = 4,
- iron = 6,
- diamond = 8,
- },
- pickaxe = {
- "wooden",
- "golden",
- "stone",
- "iron",
- "diamond",
- },
- pickaxeR = {
- wooden = 0,
- golden = 1,
- stone = 2,
- iron = 3,
- diamond = 4
- },
- axe = {
- "wooden",
- "golden",
- "stone",
- "iron",
- "diamond",
- },
- axeR = {
- wooden = 0,
- golden = 1,
- stone = 2,
- iron = 3,
- diamond = 4
- },
- }
- end))
- ModuleScript7.Name = "IDs"
- ModuleScript7.Parent = Folder0
- table.insert(cors,sandbox(ModuleScript7,function()
- local ids = {
- [0] = "Air",
- [1] = "Stone",
- [2] = "GrassBlock",
- [3] = "Dirt",
- [4] = "Cobblestone",
- [5] = "OakPlanks",
- [6] = "Sapling",
- [7] = "Bedrock",
- [8] = "Water",
- [10] = "Lava",
- [12] = "Sand",
- [13] = "Gravel",
- [15] = "IronOre",
- [16] = "CoalOre",
- [17] = "OakLog",
- [18] = "Leaves",
- [20] = "Glass",
- [31] = "Grass",
- [42] = "IronBlock",
- [45] = "Bricks",
- [49] = "Obsidian",
- [50] = "Torch",
- [51] = "Fire",
- [54] = "Chest",
- [56] = "DiamondOre",
- [57] = "DiamondBlock",
- [58] = "CraftingTable",
- [61] = "Furnace",
- [62] = "LitFurnace",
- [64] = "Door"
- }
- for i,v in pairs(require(script.Parent:WaitForChild("ItemInfo"))) do
- if v.id then
- ids[v.id] = i
- end
- end
- for i,v in pairs(require(script.Parent:WaitForChild("BlockInfo"))) do
- if v.id then
- ids[v.id] = i
- end
- end
- return ids
- end))
- ModuleScript8.Name = "SmeltRecipes"
- ModuleScript8.Parent = Folder0
- table.insert(cors,sandbox(ModuleScript8,function()
- return {
- -- Smeltable
- {
- ["Cobblestone"] = "Stone",
- ["Sand"] = "Glass",
- ["Clay"] = "Brick",
- ["IronOre"] = "IronIngot",
- ["GoldOre"] = "GoldIngot",
- ["DiamondOre"] = "Diamond", -- bruh
- ["CoalOre"] = "Coal", -- bruh
- ["RedstoneOre"] = "RedstoneDust", -- bruh
- ["OakLog"] = "Coal",
- },
- -- Fuel
- {
- ["LavaBucket"] = 20000,
- ["CoalBlock"] = 16000,
- ["Coal"] = 1600,
- ["OakPlanks"] = 300,
- ["OakLog"] = 300,
- ["CraftingTable"] = 300,
- ["Chest"] = 300,
- ["WoodenPickaxe"] = 200,
- ["WoodenAxe"] = 200,
- ["WoodenSword"] = 200,
- ["WoodenShovel"] = 200,
- ["Stick"] = 100,
- }
- }
- end))
- Folder9.Name = "ForLaterUse"
- Folder9.Parent = mas
- Sound10.Name = "Sand / Grass Step"
- Sound10.Parent = Folder9
- Sound10.SoundId = "rbxassetid://507863105"
- Sound10.Volume = 1
- Sound11.Parent = Folder9
- Sound11.SoundId = "rbxassetid://1016978163"
- Sound11.Volume = 1
- Sound12.Parent = Folder9
- Sound12.SoundId = "rbxassetid://507863457"
- Sound12.Volume = 1
- Sound13.Name = "Walking on Grass Sound"
- Sound13.Parent = Folder9
- Sound13.SoundId = "rbxassetid://379482039"
- Sound13.Volume = 2
- Sound14.Name = "Minecraft - Door Close"
- Sound14.Parent = Folder9
- Sound14.SoundId = "rbxassetid://180090455"
- Sound15.Name = "Minecraft Sounds: Fall Big"
- Sound15.Parent = Folder9
- Sound15.SoundId = "rbxassetid://535681058"
- Sound15.Volume = 1
- Sound16.Name = "Minecraft Dirt/Gravel Step"
- Sound16.Parent = Folder9
- Sound16.SoundId = "rbxassetid://507864112"
- Sound17.Name = "Minecraft Wood Step"
- Sound17.Parent = Folder9
- Sound17.SoundId = "rbxassetid://507863457"
- Sound18.Name = "Minecraft Grass Step"
- Sound18.Parent = Folder9
- Sound18.SoundId = "rbxassetid://507863105"
- Sound19.Name = "Minecraft Stone Step"
- Sound19.Parent = Folder9
- Sound19.SoundId = "rbxassetid://507863857"
- Sound19.Volume = 1
- Sky20.Name = "That old sky"
- Sky20.Parent = Folder9
- Sky20.MoonAngularSize = 9
- Sky20.MoonTextureId = "rbxassetid://1176450669"
- Sky20.SkyboxBk = "rbxassetid://2403410783"
- Sky20.SkyboxDn = "rbxassetid://2403429771"
- Sky20.SkyboxFt = "rbxassetid://2403410783"
- Sky20.SkyboxLf = "rbxassetid://2403410783"
- Sky20.SkyboxRt = "rbxassetid://2403410783"
- Sky20.SkyboxUp = "rbxassetid://2403437847"
- Sky20.StarCount = 0
- Sky20.SunAngularSize = 10
- Sky20.SunTextureId = "rbxassetid://55054494"
- Folder21.Name = "GameRemotes"
- Folder21.Parent = mas
- RemoteFunction22.Name = "BreakBlock"
- RemoteFunction22.Parent = Folder21
- RemoteFunction23.Name = "PlaceBlock"
- RemoteFunction23.Parent = Folder21
- RemoteEvent24.Name = "RequestDamage"
- RemoteEvent24.Parent = Folder21
- RemoteEvent25.Name = "OnPlaceBlock"
- RemoteEvent25.Parent = Folder21
- RemoteEvent26.Name = "OnBreakBlock"
- RemoteEvent26.Parent = Folder21
- RemoteEvent27.Name = "PlaySound"
- RemoteEvent27.Parent = Folder21
- RemoteFunction28.Name = "CancelBlock"
- RemoteFunction28.Parent = Folder21
- RemoteFunction29.Name = "AcceptBreakBlock"
- RemoteFunction29.Parent = Folder21
- RemoteFunction30.Name = "MoveItem"
- RemoteFunction30.Parent = Folder21
- RemoteFunction31.Name = "DropItem"
- RemoteFunction31.Parent = Folder21
- RemoteFunction32.Name = "ChangeSlot"
- RemoteFunction32.Parent = Folder21
- RemoteFunction33.Name = "Attack"
- RemoteFunction33.Parent = Folder21
- RemoteEvent34.Name = "ServerChat"
- RemoteEvent34.Parent = Folder21
- RemoteEvent35.Name = "BeingAttacked"
- RemoteEvent35.Parent = Folder21
- RemoteFunction36.Name = "CraftItems"
- RemoteFunction36.Parent = Folder21
- RemoteFunction37.Name = "SortItem"
- RemoteFunction37.Parent = Folder21
- RemoteEvent38.Name = "StartRecordingPos"
- RemoteEvent38.Parent = Folder21
- Folder39.Name = "PhyGroups"
- Folder39.Parent = mas
- IntValue40.Name = "Particles"
- IntValue40.Parent = Folder39
- IntValue41.Name = "Character"
- IntValue41.Parent = Folder39
- IntValue42.Name = "World"
- IntValue42.Parent = Folder39
- Folder43.Name = "PlayerPositionSaves"
- Folder43.Parent = mas
- Folder44.Name = "VisualRemotes"
- Folder44.Parent = mas
- RemoteFunction45.Name = "GetChunk"
- RemoteFunction45.Parent = Folder44
- RemoteEvent46.Name = "BlockChanged"
- RemoteEvent46.Parent = Folder44
- RemoteEvent47.Name = "UpdateBlock"
- RemoteEvent47.Parent = Folder44
- RemoteEvent48.Name = "ChangeNeckWeld"
- RemoteEvent48.Parent = Folder44
- Vector3Value49.Name = "WorldSpawn"
- Vector3Value49.Parent = mas
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game.ReplicatedStorage
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Folder0 = Instance.new("Folder")
- Part1 = Instance.new("Part")
- Decal2 = Instance.new("Decal")
- Decal3 = Instance.new("Decal")
- Decal4 = Instance.new("Decal")
- Decal5 = Instance.new("Decal")
- Decal6 = Instance.new("Decal")
- Decal7 = Instance.new("Decal")
- Part8 = Instance.new("Part")
- Decal9 = Instance.new("Decal")
- Decal10 = Instance.new("Decal")
- Decal11 = Instance.new("Decal")
- Decal12 = Instance.new("Decal")
- Decal13 = Instance.new("Decal")
- Decal14 = Instance.new("Decal")
- Part15 = Instance.new("Part")
- Decal16 = Instance.new("Decal")
- Decal17 = Instance.new("Decal")
- Decal18 = Instance.new("Decal")
- Decal19 = Instance.new("Decal")
- Decal20 = Instance.new("Decal")
- Decal21 = Instance.new("Decal")
- Part22 = Instance.new("Part")
- Decal23 = Instance.new("Decal")
- Decal24 = Instance.new("Decal")
- Decal25 = Instance.new("Decal")
- Decal26 = Instance.new("Decal")
- Decal27 = Instance.new("Decal")
- Decal28 = Instance.new("Decal")
- Part29 = Instance.new("Part")
- Decal30 = Instance.new("Decal")
- Decal31 = Instance.new("Decal")
- Decal32 = Instance.new("Decal")
- Decal33 = Instance.new("Decal")
- Decal34 = Instance.new("Decal")
- Decal35 = Instance.new("Decal")
- Part36 = Instance.new("Part")
- Decal37 = Instance.new("Decal")
- Decal38 = Instance.new("Decal")
- Decal39 = Instance.new("Decal")
- Decal40 = Instance.new("Decal")
- Decal41 = Instance.new("Decal")
- Decal42 = Instance.new("Decal")
- Part43 = Instance.new("Part")
- Decal44 = Instance.new("Decal")
- Decal45 = Instance.new("Decal")
- Decal46 = Instance.new("Decal")
- Decal47 = Instance.new("Decal")
- Decal48 = Instance.new("Decal")
- Decal49 = Instance.new("Decal")
- Part50 = Instance.new("Part")
- Decal51 = Instance.new("Decal")
- Decal52 = Instance.new("Decal")
- Decal53 = Instance.new("Decal")
- Decal54 = Instance.new("Decal")
- Decal55 = Instance.new("Decal")
- Decal56 = Instance.new("Decal")
- Part57 = Instance.new("Part")
- Decal58 = Instance.new("Decal")
- Decal59 = Instance.new("Decal")
- Decal60 = Instance.new("Decal")
- Decal61 = Instance.new("Decal")
- Decal62 = Instance.new("Decal")
- Decal63 = Instance.new("Decal")
- Model64 = Instance.new("Model")
- Part65 = Instance.new("Part")
- Part66 = Instance.new("Part")
- Decal67 = Instance.new("Decal")
- BlockMesh68 = Instance.new("BlockMesh")
- Decal69 = Instance.new("Decal")
- Part70 = Instance.new("Part")
- Decal71 = Instance.new("Decal")
- BlockMesh72 = Instance.new("BlockMesh")
- Decal73 = Instance.new("Decal")
- Part74 = Instance.new("Part")
- Decal75 = Instance.new("Decal")
- Decal76 = Instance.new("Decal")
- Decal77 = Instance.new("Decal")
- Decal78 = Instance.new("Decal")
- Decal79 = Instance.new("Decal")
- Decal80 = Instance.new("Decal")
- Part81 = Instance.new("Part")
- Decal82 = Instance.new("Decal")
- Decal83 = Instance.new("Decal")
- Decal84 = Instance.new("Decal")
- Decal85 = Instance.new("Decal")
- Decal86 = Instance.new("Decal")
- Decal87 = Instance.new("Decal")
- Part88 = Instance.new("Part")
- Decal89 = Instance.new("Decal")
- Decal90 = Instance.new("Decal")
- Decal91 = Instance.new("Decal")
- Decal92 = Instance.new("Decal")
- Decal93 = Instance.new("Decal")
- Decal94 = Instance.new("Decal")
- Part95 = Instance.new("Part")
- Decal96 = Instance.new("Decal")
- Decal97 = Instance.new("Decal")
- Decal98 = Instance.new("Decal")
- Decal99 = Instance.new("Decal")
- Decal100 = Instance.new("Decal")
- Decal101 = Instance.new("Decal")
- Part102 = Instance.new("Part")
- Decal103 = Instance.new("Decal")
- Decal104 = Instance.new("Decal")
- Decal105 = Instance.new("Decal")
- Decal106 = Instance.new("Decal")
- Decal107 = Instance.new("Decal")
- Decal108 = Instance.new("Decal")
- Part109 = Instance.new("Part")
- Decal110 = Instance.new("Decal")
- Decal111 = Instance.new("Decal")
- Decal112 = Instance.new("Decal")
- Decal113 = Instance.new("Decal")
- Decal114 = Instance.new("Decal")
- Decal115 = Instance.new("Decal")
- Part116 = Instance.new("Part")
- Decal117 = Instance.new("Decal")
- Decal118 = Instance.new("Decal")
- Decal119 = Instance.new("Decal")
- Decal120 = Instance.new("Decal")
- Decal121 = Instance.new("Decal")
- Decal122 = Instance.new("Decal")
- Part123 = Instance.new("Part")
- Decal124 = Instance.new("Decal")
- Decal125 = Instance.new("Decal")
- Decal126 = Instance.new("Decal")
- Decal127 = Instance.new("Decal")
- Decal128 = Instance.new("Decal")
- Decal129 = Instance.new("Decal")
- Part130 = Instance.new("Part")
- Decal131 = Instance.new("Decal")
- Decal132 = Instance.new("Decal")
- Decal133 = Instance.new("Decal")
- Decal134 = Instance.new("Decal")
- Decal135 = Instance.new("Decal")
- Decal136 = Instance.new("Decal")
- Part137 = Instance.new("Part")
- BlockMesh138 = Instance.new("BlockMesh")
- Texture139 = Instance.new("Texture")
- Texture140 = Instance.new("Texture")
- Part141 = Instance.new("Part")
- PointLight142 = Instance.new("PointLight")
- Texture143 = Instance.new("Texture")
- Texture144 = Instance.new("Texture")
- Texture145 = Instance.new("Texture")
- Texture146 = Instance.new("Texture")
- Texture147 = Instance.new("Texture")
- Texture148 = Instance.new("Texture")
- Part149 = Instance.new("Part")
- SurfaceGui150 = Instance.new("SurfaceGui")
- Frame151 = Instance.new("Frame")
- Frame152 = Instance.new("Frame")
- Frame153 = Instance.new("Frame")
- Frame154 = Instance.new("Frame")
- Frame155 = Instance.new("Frame")
- Frame156 = Instance.new("Frame")
- Frame157 = Instance.new("Frame")
- Frame158 = Instance.new("Frame")
- Frame159 = Instance.new("Frame")
- Frame160 = Instance.new("Frame")
- Frame161 = Instance.new("Frame")
- Frame162 = Instance.new("Frame")
- SurfaceGui163 = Instance.new("SurfaceGui")
- Frame164 = Instance.new("Frame")
- Frame165 = Instance.new("Frame")
- Frame166 = Instance.new("Frame")
- Frame167 = Instance.new("Frame")
- Frame168 = Instance.new("Frame")
- Frame169 = Instance.new("Frame")
- Frame170 = Instance.new("Frame")
- Frame171 = Instance.new("Frame")
- Frame172 = Instance.new("Frame")
- Frame173 = Instance.new("Frame")
- Frame174 = Instance.new("Frame")
- Frame175 = Instance.new("Frame")
- SurfaceGui176 = Instance.new("SurfaceGui")
- Frame177 = Instance.new("Frame")
- Frame178 = Instance.new("Frame")
- Frame179 = Instance.new("Frame")
- Frame180 = Instance.new("Frame")
- Frame181 = Instance.new("Frame")
- Frame182 = Instance.new("Frame")
- Frame183 = Instance.new("Frame")
- Frame184 = Instance.new("Frame")
- Frame185 = Instance.new("Frame")
- Frame186 = Instance.new("Frame")
- Frame187 = Instance.new("Frame")
- Frame188 = Instance.new("Frame")
- SurfaceGui189 = Instance.new("SurfaceGui")
- Frame190 = Instance.new("Frame")
- Frame191 = Instance.new("Frame")
- Frame192 = Instance.new("Frame")
- Frame193 = Instance.new("Frame")
- Frame194 = Instance.new("Frame")
- Frame195 = Instance.new("Frame")
- Frame196 = Instance.new("Frame")
- Frame197 = Instance.new("Frame")
- Frame198 = Instance.new("Frame")
- Frame199 = Instance.new("Frame")
- Frame200 = Instance.new("Frame")
- Frame201 = Instance.new("Frame")
- SurfaceGui202 = Instance.new("SurfaceGui")
- Frame203 = Instance.new("Frame")
- Frame204 = Instance.new("Frame")
- Frame205 = Instance.new("Frame")
- Frame206 = Instance.new("Frame")
- Frame207 = Instance.new("Frame")
- Frame208 = Instance.new("Frame")
- Frame209 = Instance.new("Frame")
- Frame210 = Instance.new("Frame")
- Frame211 = Instance.new("Frame")
- Frame212 = Instance.new("Frame")
- Frame213 = Instance.new("Frame")
- Frame214 = Instance.new("Frame")
- SurfaceGui215 = Instance.new("SurfaceGui")
- Frame216 = Instance.new("Frame")
- Frame217 = Instance.new("Frame")
- Frame218 = Instance.new("Frame")
- Frame219 = Instance.new("Frame")
- Frame220 = Instance.new("Frame")
- Frame221 = Instance.new("Frame")
- Frame222 = Instance.new("Frame")
- Frame223 = Instance.new("Frame")
- Frame224 = Instance.new("Frame")
- Frame225 = Instance.new("Frame")
- Frame226 = Instance.new("Frame")
- Frame227 = Instance.new("Frame")
- PointLight228 = Instance.new("PointLight")
- UnionOperation229 = Instance.new("UnionOperation")
- Folder0.Name = "Blocks"
- Folder0.Parent = mas
- Part1.Name = "Bedrock"
- Part1.Parent = Folder0
- Part1.CFrame = CFrame.new(-12.5, 1.49999905, 12.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.Position = Vector3.new(-12.5, 1.49999905, 12.5)
- Part1.Size = Vector3.new(3, 3, 3)
- Part1.Anchored = true
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Decal2.Parent = Part1
- Decal2.Texture = "rbxassetid://75881126"
- Decal2.Face = Enum.NormalId.Right
- Decal3.Parent = Part1
- Decal3.Texture = "rbxassetid://75881126"
- Decal3.Face = Enum.NormalId.Back
- Decal4.Parent = Part1
- Decal4.Texture = "rbxassetid://75881126"
- Decal4.Face = Enum.NormalId.Left
- Decal5.Parent = Part1
- Decal5.Texture = "rbxassetid://75881126"
- Decal6.Parent = Part1
- Decal6.Texture = "rbxassetid://75881126"
- Decal6.Face = Enum.NormalId.Top
- Decal7.Parent = Part1
- Decal7.Texture = "rbxassetid://75881126"
- Decal7.Face = Enum.NormalId.Bottom
- Part8.Name = "Cobblestone"
- Part8.Parent = Folder0
- Part8.CFrame = CFrame.new(-3.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part8.Position = Vector3.new(-3.5, 4.50001383, 1.5)
- Part8.Size = Vector3.new(3, 3, 3)
- Part8.Anchored = true
- Part8.BottomSurface = Enum.SurfaceType.Smooth
- Part8.TopSurface = Enum.SurfaceType.Smooth
- Decal9.Parent = Part8
- Decal9.Texture = "rbxassetid://152572105"
- Decal9.Face = Enum.NormalId.Right
- Decal10.Parent = Part8
- Decal10.Texture = "rbxassetid://152572105"
- Decal10.Face = Enum.NormalId.Back
- Decal11.Parent = Part8
- Decal11.Texture = "rbxassetid://152572105"
- Decal11.Face = Enum.NormalId.Left
- Decal12.Parent = Part8
- Decal12.Texture = "rbxassetid://152572105"
- Decal13.Parent = Part8
- Decal13.Texture = "rbxassetid://152572105"
- Decal13.Face = Enum.NormalId.Top
- Decal14.Parent = Part8
- Decal14.Texture = "rbxassetid://152572105"
- Decal14.Face = Enum.NormalId.Bottom
- Part15.Name = "DiamondBlock"
- Part15.Parent = Folder0
- Part15.CFrame = CFrame.new(-12.5, 4.50001383, 8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part15.Position = Vector3.new(-12.5, 4.50001383, 8.5)
- Part15.Size = Vector3.new(3, 3, 3)
- Part15.Anchored = true
- Part15.BottomSurface = Enum.SurfaceType.Smooth
- Part15.TopSurface = Enum.SurfaceType.Smooth
- Decal16.Parent = Part15
- Decal16.Texture = "rbxassetid://152572109"
- Decal16.Face = Enum.NormalId.Right
- Decal17.Parent = Part15
- Decal17.Texture = "rbxassetid://152572109"
- Decal17.Face = Enum.NormalId.Back
- Decal18.Parent = Part15
- Decal18.Texture = "rbxassetid://152572109"
- Decal18.Face = Enum.NormalId.Left
- Decal19.Parent = Part15
- Decal19.Texture = "rbxassetid://152572109"
- Decal20.Parent = Part15
- Decal20.Texture = "rbxassetid://152572109"
- Decal20.Face = Enum.NormalId.Top
- Decal21.Parent = Part15
- Decal21.Texture = "rbxassetid://152572109"
- Decal21.Face = Enum.NormalId.Bottom
- Part22.Name = "Dirt"
- Part22.Parent = Folder0
- Part22.CFrame = CFrame.new(-9.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part22.Position = Vector3.new(-9.5, 4.50001383, 1.5)
- Part22.Size = Vector3.new(3, 3, 3)
- Part22.Anchored = true
- Part22.BottomSurface = Enum.SurfaceType.Smooth
- Part22.TopSurface = Enum.SurfaceType.Smooth
- Decal23.Parent = Part22
- Decal23.Texture = "rbxassetid://152569532"
- Decal23.Face = Enum.NormalId.Right
- Decal24.Parent = Part22
- Decal24.Texture = "rbxassetid://152569532"
- Decal24.Face = Enum.NormalId.Back
- Decal25.Parent = Part22
- Decal25.Texture = "rbxassetid://152569532"
- Decal25.Face = Enum.NormalId.Left
- Decal26.Parent = Part22
- Decal26.Texture = "rbxassetid://152569532"
- Decal27.Parent = Part22
- Decal27.Texture = "rbxassetid://152569532"
- Decal27.Face = Enum.NormalId.Top
- Decal28.Parent = Part22
- Decal28.Texture = "rbxassetid://152569532"
- Decal28.Face = Enum.NormalId.Bottom
- Part29.Name = "GrassBlock"
- Part29.Parent = Folder0
- Part29.CFrame = CFrame.new(-12.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part29.Position = Vector3.new(-12.5, 4.50001383, 1.5)
- Part29.Size = Vector3.new(3, 3, 3)
- Part29.Anchored = true
- Part29.BottomSurface = Enum.SurfaceType.Smooth
- Part29.TopSurface = Enum.SurfaceType.Smooth
- Decal30.Parent = Part29
- Decal30.Texture = "rbxassetid://96430337"
- Decal30.Face = Enum.NormalId.Right
- Decal31.Parent = Part29
- Decal31.Texture = "rbxassetid://96430337"
- Decal31.Face = Enum.NormalId.Back
- Decal32.Parent = Part29
- Decal32.Texture = "rbxassetid://96430337"
- Decal32.Face = Enum.NormalId.Left
- Decal33.Parent = Part29
- Decal33.Texture = "rbxassetid://96430337"
- Decal34.Parent = Part29
- Decal34.Texture = "rbxassetid://96430265"
- Decal34.Face = Enum.NormalId.Top
- Decal35.Parent = Part29
- Decal35.Texture = "rbxassetid://152569532"
- Decal35.Face = Enum.NormalId.Bottom
- Part36.Name = "IronBlock"
- Part36.Parent = Folder0
- Part36.CFrame = CFrame.new(-9.5, 4.50001383, 8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part36.Position = Vector3.new(-9.5, 4.50001383, 8.5)
- Part36.Size = Vector3.new(3, 3, 3)
- Part36.Anchored = true
- Part36.BottomSurface = Enum.SurfaceType.Smooth
- Part36.TopSurface = Enum.SurfaceType.Smooth
- Decal37.Parent = Part36
- Decal37.Texture = "rbxassetid://152572134"
- Decal37.Face = Enum.NormalId.Right
- Decal38.Parent = Part36
- Decal38.Texture = "rbxassetid://152572134"
- Decal38.Face = Enum.NormalId.Back
- Decal39.Parent = Part36
- Decal39.Texture = "rbxassetid://152572134"
- Decal39.Face = Enum.NormalId.Left
- Decal40.Parent = Part36
- Decal40.Texture = "rbxassetid://152572134"
- Decal41.Parent = Part36
- Decal41.Texture = "rbxassetid://152572134"
- Decal41.Face = Enum.NormalId.Top
- Decal42.Parent = Part36
- Decal42.Texture = "rbxassetid://152572134"
- Decal42.Face = Enum.NormalId.Bottom
- Part43.Name = "Leaves"
- Part43.Parent = Folder0
- Part43.CFrame = CFrame.new(0, 1.50001204, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part43.Position = Vector3.new(0, 1.50001204, 0)
- Part43.Color = Color3.new(0.113725, 0.407843, 0.0784314)
- Part43.Size = Vector3.new(3, 3, 3)
- Part43.Anchored = true
- Part43.BottomSurface = Enum.SurfaceType.Smooth
- Part43.BrickColor = BrickColor.new("Parsley green")
- Part43.Material = Enum.Material.Grass
- Part43.TopSurface = Enum.SurfaceType.Smooth
- Part43.brickColor = BrickColor.new("Parsley green")
- Decal44.Parent = Part43
- Decal44.Texture = "rbxassetid://140507911"
- Decal44.Face = Enum.NormalId.Right
- Decal45.Parent = Part43
- Decal45.Texture = "rbxassetid://140507911"
- Decal45.Face = Enum.NormalId.Back
- Decal46.Parent = Part43
- Decal46.Texture = "rbxassetid://140507911"
- Decal46.Face = Enum.NormalId.Left
- Decal47.Parent = Part43
- Decal47.Texture = "rbxassetid://140507911"
- Decal48.Parent = Part43
- Decal48.Texture = "rbxassetid://140507911"
- Decal48.Face = Enum.NormalId.Top
- Decal49.Parent = Part43
- Decal49.Texture = "rbxassetid://140507911"
- Decal49.Face = Enum.NormalId.Bottom
- Part50.Name = "OakPlanks"
- Part50.Parent = Folder0
- Part50.CFrame = CFrame.new(3.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part50.Position = Vector3.new(3.5, 4.50001383, 1.5)
- Part50.Size = Vector3.new(3, 3, 3)
- Part50.Anchored = true
- Part50.BottomSurface = Enum.SurfaceType.Smooth
- Part50.TopSurface = Enum.SurfaceType.Smooth
- Decal51.Parent = Part50
- Decal51.Texture = "rbxassetid://152572161"
- Decal51.Face = Enum.NormalId.Right
- Decal52.Parent = Part50
- Decal52.Texture = "rbxassetid://152572161"
- Decal52.Face = Enum.NormalId.Back
- Decal53.Parent = Part50
- Decal53.Texture = "rbxassetid://152572161"
- Decal53.Face = Enum.NormalId.Left
- Decal54.Parent = Part50
- Decal54.Texture = "rbxassetid://152572161"
- Decal55.Parent = Part50
- Decal55.Texture = "rbxassetid://152572161"
- Decal55.Face = Enum.NormalId.Top
- Decal56.Parent = Part50
- Decal56.Texture = "rbxassetid://152572161"
- Decal56.Face = Enum.NormalId.Bottom
- Part57.Name = "Stone"
- Part57.Parent = Folder0
- Part57.CFrame = CFrame.new(-6.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part57.Position = Vector3.new(-6.5, 4.50001383, 1.5)
- Part57.Size = Vector3.new(3, 3, 3)
- Part57.Anchored = true
- Part57.BottomSurface = Enum.SurfaceType.Smooth
- Part57.TopSurface = Enum.SurfaceType.Smooth
- Decal58.Parent = Part57
- Decal58.Texture = "rbxassetid://75880927"
- Decal58.Face = Enum.NormalId.Right
- Decal59.Parent = Part57
- Decal59.Texture = "rbxassetid://75880927"
- Decal59.Face = Enum.NormalId.Back
- Decal60.Parent = Part57
- Decal60.Texture = "rbxassetid://75880927"
- Decal60.Face = Enum.NormalId.Left
- Decal61.Parent = Part57
- Decal61.Texture = "rbxassetid://75880927"
- Decal62.Parent = Part57
- Decal62.Texture = "rbxassetid://75880927"
- Decal62.Face = Enum.NormalId.Top
- Decal63.Parent = Part57
- Decal63.Texture = "rbxassetid://75880927"
- Decal63.Face = Enum.NormalId.Bottom
- Model64.Name = "Grass"
- Model64.Parent = Folder0
- Model64.PrimaryPart = Part65
- Part65.Name = "Base"
- Part65.Parent = Model64
- Part65.CFrame = CFrame.new(-4.47034836e-08, 4.50002289, -2.23517418e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part65.Position = Vector3.new(-4.47034836e-08, 4.50002289, -2.23517418e-08)
- Part65.Transparency = 1
- Part65.Size = Vector3.new(3, 3, 3)
- Part65.BottomSurface = Enum.SurfaceType.Smooth
- Part65.TopSurface = Enum.SurfaceType.Smooth
- Part66.Parent = Model64
- 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)
- Part66.Orientation = Vector3.new(0, -45, 0)
- Part66.Position = Vector3.new(-4.47034836e-08, 4.50002289, 7.4505806e-09)
- Part66.Rotation = Vector3.new(0, -45, 0)
- Part66.Transparency = 1
- Part66.Size = Vector3.new(3, 3, 1)
- Part66.BottomSurface = Enum.SurfaceType.Smooth
- Part66.TopSurface = Enum.SurfaceType.Smooth
- Decal67.Name = "Grass"
- Decal67.Parent = Part66
- Decal67.Texture = "http://www.roblox.com/asset/?id=151787580"
- BlockMesh68.Parent = Part66
- BlockMesh68.Scale = Vector3.new(1, 1, 0)
- Decal69.Name = "Grass"
- Decal69.Parent = Part66
- Decal69.Texture = "http://www.roblox.com/asset/?id=151787580"
- Decal69.Face = Enum.NormalId.Back
- Part70.Parent = Model64
- Part70.CFrame = CFrame.new(-4.47034836e-08, 4.50002289, 0, -0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, -0.707106829)
- Part70.Orientation = Vector3.new(0, -135, 0)
- Part70.Position = Vector3.new(-4.47034836e-08, 4.50002289, 0)
- Part70.Rotation = Vector3.new(-180, -45, -180)
- Part70.Transparency = 1
- Part70.Size = Vector3.new(3, 3, 1)
- Part70.BottomSurface = Enum.SurfaceType.Smooth
- Part70.TopSurface = Enum.SurfaceType.Smooth
- Decal71.Name = "Grass"
- Decal71.Parent = Part70
- Decal71.Texture = "http://www.roblox.com/asset/?id=151787580"
- BlockMesh72.Parent = Part70
- BlockMesh72.Scale = Vector3.new(1, 1, 0)
- Decal73.Name = "Grass"
- Decal73.Parent = Part70
- Decal73.Texture = "http://www.roblox.com/asset/?id=151787580"
- Decal73.Face = Enum.NormalId.Back
- Part74.Name = "Glass"
- Part74.Parent = Folder0
- Part74.CFrame = CFrame.new(-6.5, 4.50001383, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part74.Position = Vector3.new(-6.5, 4.50001383, 1.5)
- Part74.Transparency = 1
- Part74.Size = Vector3.new(3, 3, 3)
- Part74.Anchored = true
- Part74.BottomSurface = Enum.SurfaceType.Smooth
- Part74.TopSurface = Enum.SurfaceType.Smooth
- Decal75.Parent = Part74
- Decal75.Texture = "rbxassetid://152239003"
- Decal75.Face = Enum.NormalId.Right
- Decal76.Parent = Part74
- Decal76.Texture = "rbxassetid://152239003"
- Decal76.Face = Enum.NormalId.Back
- Decal77.Parent = Part74
- Decal77.Texture = "rbxassetid://152239003"
- Decal77.Face = Enum.NormalId.Left
- Decal78.Parent = Part74
- Decal78.Texture = "rbxassetid://152239003"
- Decal79.Parent = Part74
- Decal79.Texture = "rbxassetid://152239003"
- Decal79.Face = Enum.NormalId.Top
- Decal80.Parent = Part74
- Decal80.Texture = "rbxassetid://152239003"
- Decal80.Face = Enum.NormalId.Bottom
- Part81.Name = "OakLog"
- Part81.Parent = Folder0
- Part81.CFrame = CFrame.new(0, 1.50001204, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part81.Position = Vector3.new(0, 1.50001204, 0)
- Part81.Size = Vector3.new(3, 3, 3)
- Part81.Anchored = true
- Part81.BottomSurface = Enum.SurfaceType.Smooth
- Part81.TopSurface = Enum.SurfaceType.Smooth
- Decal82.Parent = Part81
- Decal82.Texture = "rbxassetid://3595677229"
- Decal82.Face = Enum.NormalId.Right
- Decal83.Parent = Part81
- Decal83.Texture = "rbxassetid://3595677229"
- Decal83.Face = Enum.NormalId.Back
- Decal84.Parent = Part81
- Decal84.Texture = "rbxassetid://3595677229"
- Decal84.Face = Enum.NormalId.Left
- Decal85.Parent = Part81
- Decal85.Texture = "rbxassetid://3595677229"
- Decal86.Parent = Part81
- Decal86.Texture = "rbxassetid://3595694398"
- Decal86.Face = Enum.NormalId.Top
- Decal87.Parent = Part81
- Decal87.Texture = "rbxassetid://3595694398"
- Decal87.Face = Enum.NormalId.Bottom
- Part88.Name = "Obsidian"
- Part88.Parent = Folder0
- Part88.CFrame = CFrame.new(0.5, 1.50001204, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part88.Position = Vector3.new(0.5, 1.50001204, -0.5)
- Part88.Size = Vector3.new(3, 3, 3)
- Part88.Anchored = true
- Part88.BottomSurface = Enum.SurfaceType.Smooth
- Part88.TopSurface = Enum.SurfaceType.Smooth
- Decal89.Parent = Part88
- Decal89.Texture = "rbxassetid://146215703"
- Decal89.Face = Enum.NormalId.Right
- Decal90.Parent = Part88
- Decal90.Texture = "rbxassetid://146215703"
- Decal90.Face = Enum.NormalId.Back
- Decal91.Parent = Part88
- Decal91.Texture = "rbxassetid://146215703"
- Decal91.Face = Enum.NormalId.Left
- Decal92.Parent = Part88
- Decal92.Texture = "rbxassetid://146215703"
- Decal93.Parent = Part88
- Decal93.Texture = "rbxassetid://146215703"
- Decal93.Face = Enum.NormalId.Top
- Decal94.Parent = Part88
- Decal94.Texture = "rbxassetid://146215703"
- Decal94.Face = Enum.NormalId.Bottom
- Part95.Name = "CraftingTable"
- Part95.Parent = Folder0
- Part95.CFrame = CFrame.new(-4.5, 7.50001001, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part95.Position = Vector3.new(-4.5, 7.50001001, -0.5)
- Part95.Size = Vector3.new(3, 3, 3)
- Part95.Anchored = true
- Part95.BottomSurface = Enum.SurfaceType.Smooth
- Part95.TopSurface = Enum.SurfaceType.Smooth
- Decal96.Parent = Part95
- Decal96.Texture = "http://www.roblox.com/asset/?id=151913790"
- Decal96.Face = Enum.NormalId.Top
- Decal97.Parent = Part95
- Decal97.Texture = "http://www.roblox.com/asset/?id=151913772"
- Decal97.Face = Enum.NormalId.Left
- Decal98.Parent = Part95
- Decal98.Texture = "http://www.roblox.com/asset/?id=151913772"
- Decal98.Face = Enum.NormalId.Right
- Decal99.Parent = Part95
- Decal99.Texture = "rbxassetid://152572161"
- Decal99.Face = Enum.NormalId.Bottom
- Decal100.Parent = Part95
- Decal100.Texture = "http://www.roblox.com/asset/?id=151913757"
- Decal101.Parent = Part95
- Decal101.Texture = "http://www.roblox.com/asset/?id=151913772"
- Decal101.Face = Enum.NormalId.Back
- Part102.Name = "Furnace"
- Part102.Parent = Folder0
- Part102.CFrame = CFrame.new(0.5, 1.50001597, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part102.Position = Vector3.new(0.5, 1.50001597, 0.5)
- Part102.Size = Vector3.new(3, 3, 3)
- Part102.Anchored = true
- Part102.BottomSurface = Enum.SurfaceType.Smooth
- Part102.TopSurface = Enum.SurfaceType.Smooth
- Decal103.Parent = Part102
- Decal103.Texture = "http://www.roblox.com/asset/?id=151920519"
- Decal104.Parent = Part102
- Decal104.Texture = "http://www.roblox.com/asset/?id=151920532"
- Decal104.Face = Enum.NormalId.Top
- Decal105.Parent = Part102
- Decal105.Texture = "http://www.roblox.com/asset/?id=151920532"
- Decal105.Face = Enum.NormalId.Left
- Decal106.Parent = Part102
- Decal106.Texture = "http://www.roblox.com/asset/?id=151920532"
- Decal106.Face = Enum.NormalId.Right
- Decal107.Parent = Part102
- Decal107.Texture = "http://www.roblox.com/asset/?id=151920532"
- Decal107.Face = Enum.NormalId.Back
- Decal108.Parent = Part102
- Decal108.Texture = "http://www.roblox.com/asset/?id=151920532"
- Decal108.Face = Enum.NormalId.Bottom
- Part109.Name = "DiamondOre"
- Part109.Parent = Folder0
- Part109.CFrame = CFrame.new(-3.5, 4.5, 1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part109.Position = Vector3.new(-3.5, 4.5, 1.5)
- Part109.Size = Vector3.new(3, 3, 3)
- Part109.Anchored = true
- Part109.BottomSurface = Enum.SurfaceType.Smooth
- Part109.TopSurface = Enum.SurfaceType.Smooth
- Decal110.Parent = Part109
- Decal110.Texture = "rbxassetid://152572119"
- Decal110.Face = Enum.NormalId.Right
- Decal111.Parent = Part109
- Decal111.Texture = "rbxassetid://152572119"
- Decal111.Face = Enum.NormalId.Back
- Decal112.Parent = Part109
- Decal112.Texture = "rbxassetid://152572119"
- Decal112.Face = Enum.NormalId.Left
- Decal113.Parent = Part109
- Decal113.Texture = "rbxassetid://152572119"
- Decal114.Parent = Part109
- Decal114.Texture = "rbxassetid://152572119"
- Decal114.Face = Enum.NormalId.Top
- Decal115.Parent = Part109
- Decal115.Texture = "rbxassetid://152572119"
- Decal115.Face = Enum.NormalId.Bottom
- Part116.Name = "CoalOre"
- Part116.Parent = Folder0
- Part116.CFrame = CFrame.new(0.5, 1.50001204, -5.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part116.Position = Vector3.new(0.5, 1.50001204, -5.5)
- Part116.Size = Vector3.new(3, 3, 3)
- Part116.Anchored = true
- Part116.BottomSurface = Enum.SurfaceType.Smooth
- Part116.TopSurface = Enum.SurfaceType.Smooth
- Decal117.Parent = Part116
- Decal117.Texture = "rbxassetid://152572101"
- Decal117.Face = Enum.NormalId.Right
- Decal118.Parent = Part116
- Decal118.Texture = "rbxassetid://152572101"
- Decal118.Face = Enum.NormalId.Back
- Decal119.Parent = Part116
- Decal119.Texture = "rbxassetid://152572101"
- Decal119.Face = Enum.NormalId.Left
- Decal120.Parent = Part116
- Decal120.Texture = "rbxassetid://152572101"
- Decal121.Parent = Part116
- Decal121.Texture = "rbxassetid://152572101"
- Decal121.Face = Enum.NormalId.Top
- Decal122.Parent = Part116
- Decal122.Texture = "rbxassetid://152572101"
- Decal122.Face = Enum.NormalId.Bottom
- Part123.Name = "IronOre"
- Part123.Parent = Folder0
- Part123.CFrame = CFrame.new(0.5, 1.50001204, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part123.Position = Vector3.new(0.5, 1.50001204, -0.5)
- Part123.Size = Vector3.new(3, 3, 3)
- Part123.Anchored = true
- Part123.BottomSurface = Enum.SurfaceType.Smooth
- Part123.TopSurface = Enum.SurfaceType.Smooth
- Decal124.Parent = Part123
- Decal124.Texture = "rbxassetid://152572136"
- Decal124.Face = Enum.NormalId.Right
- Decal125.Parent = Part123
- Decal125.Texture = "rbxassetid://152572136"
- Decal125.Face = Enum.NormalId.Back
- Decal126.Parent = Part123
- Decal126.Texture = "rbxassetid://152572136"
- Decal126.Face = Enum.NormalId.Left
- Decal127.Parent = Part123
- Decal127.Texture = "rbxassetid://152572136"
- Decal128.Parent = Part123
- Decal128.Texture = "rbxassetid://152572136"
- Decal128.Face = Enum.NormalId.Top
- Decal129.Parent = Part123
- Decal129.Texture = "rbxassetid://152572136"
- Decal129.Face = Enum.NormalId.Bottom
- Part130.Name = "Sand"
- Part130.Parent = Folder0
- Part130.CFrame = CFrame.new(0.5, 1.50001204, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part130.Position = Vector3.new(0.5, 1.50001204, -0.5)
- Part130.Size = Vector3.new(3, 3, 3)
- Part130.Anchored = true
- Part130.BottomSurface = Enum.SurfaceType.Smooth
- Part130.TopSurface = Enum.SurfaceType.Smooth
- Decal131.Parent = Part130
- Decal131.Texture = "rbxassetid://152572215"
- Decal131.Face = Enum.NormalId.Right
- Decal132.Parent = Part130
- Decal132.Texture = "rbxassetid://152572215"
- Decal132.Face = Enum.NormalId.Back
- Decal133.Parent = Part130
- Decal133.Texture = "rbxassetid://152572215"
- Decal133.Face = Enum.NormalId.Left
- Decal134.Parent = Part130
- Decal134.Texture = "rbxassetid://152572215"
- Decal135.Parent = Part130
- Decal135.Texture = "rbxassetid://152572215"
- Decal135.Face = Enum.NormalId.Top
- Decal136.Parent = Part130
- Decal136.Texture = "rbxassetid://152572215"
- Decal136.Face = Enum.NormalId.Bottom
- Part137.Name = "Water"
- Part137.Parent = Folder0
- Part137.CFrame = CFrame.new(440, 0.500007987, -205, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part137.Position = Vector3.new(440, 0.500007987, -205)
- Part137.Transparency = 1
- Part137.Size = Vector3.new(3, 3, 3)
- Part137.Anchored = true
- Part137.BottomSurface = Enum.SurfaceType.Smooth
- Part137.CanCollide = false
- Part137.TopSurface = Enum.SurfaceType.Smooth
- BlockMesh138.Parent = Part137
- BlockMesh138.Offset = Vector3.new(0, 1.35000002, 0)
- BlockMesh138.Scale = Vector3.new(1, 0, 1)
- Texture139.Name = "TexTop"
- Texture139.Parent = Part137
- Texture139.Texture = "rbxassetid://204384984"
- Texture139.Transparency = 0.079999998211861
- Texture139.Face = Enum.NormalId.Top
- Texture139.StudsPerTileU = 3
- Texture139.StudsPerTileV = 3
- Texture140.Name = "TexBottom"
- Texture140.Parent = Part137
- Texture140.Texture = "rbxassetid://204384984"
- Texture140.Transparency = 0.079999998211861
- Texture140.Face = Enum.NormalId.Bottom
- Texture140.StudsPerTileU = 3
- Texture140.StudsPerTileV = 3
- Part141.Name = "Lava"
- Part141.Parent = Folder0
- Part141.CFrame = CFrame.new(0, 1.50000095, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part141.Position = Vector3.new(0, 1.50000095, 0)
- Part141.Transparency = 1
- Part141.Size = Vector3.new(3, 3, 3)
- Part141.Anchored = true
- Part141.BottomSurface = Enum.SurfaceType.Smooth
- Part141.CanCollide = false
- Part141.TopSurface = Enum.SurfaceType.Smooth
- PointLight142.Parent = Part141
- PointLight142.Color = Color3.new(1, 0.741176, 0.513726)
- PointLight142.Range = 16
- PointLight142.Brightness = 0.60000002384186
- PointLight142.Shadows = true
- Texture143.Parent = Part141
- Texture143.Texture = "rbxassetid://152572155"
- Texture143.Transparency = 0.079999998211861
- Texture143.Face = Enum.NormalId.Bottom
- Texture143.StudsPerTileU = 3
- Texture143.StudsPerTileV = 3
- Texture144.Parent = Part141
- Texture144.Texture = "rbxassetid://152572155"
- Texture144.Transparency = 0.079999998211861
- Texture144.Face = Enum.NormalId.Top
- Texture144.StudsPerTileU = 3
- Texture144.StudsPerTileV = 3
- Texture145.Parent = Part141
- Texture145.Texture = "rbxassetid://152572155"
- Texture145.Transparency = 0.079999998211861
- Texture145.Face = Enum.NormalId.Left
- Texture145.StudsPerTileU = 3
- Texture145.StudsPerTileV = 3
- Texture146.Parent = Part141
- Texture146.Texture = "rbxassetid://152572155"
- Texture146.Transparency = 0.079999998211861
- Texture146.Face = Enum.NormalId.Right
- Texture146.StudsPerTileU = 3
- Texture146.StudsPerTileV = 3
- Texture147.Parent = Part141
- Texture147.Texture = "rbxassetid://152572155"
- Texture147.Transparency = 0.079999998211861
- Texture147.Face = Enum.NormalId.Back
- Texture147.StudsPerTileU = 3
- Texture147.StudsPerTileV = 3
- Texture148.Parent = Part141
- Texture148.Texture = "rbxassetid://152572155"
- Texture148.Transparency = 0.079999998211861
- Texture148.StudsPerTileU = 3
- Texture148.StudsPerTileV = 3
- Part149.Name = "Torch"
- Part149.Parent = Folder0
- Part149.CFrame = CFrame.new(-17, 0.500003994, 5.29999924, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part149.Position = Vector3.new(-17, 0.500003994, 5.29999924)
- Part149.Size = Vector3.new(0.375, 1.875, 0.375)
- Part149.Anchored = true
- Part149.BottomSurface = Enum.SurfaceType.Smooth
- Part149.CanCollide = false
- Part149.Material = Enum.Material.SmoothPlastic
- Part149.TopSurface = Enum.SurfaceType.Smooth
- SurfaceGui150.Parent = Part149
- SurfaceGui150.ClipsDescendants = true
- SurfaceGui150.CanvasSize = Vector2.new(4, 20)
- SurfaceGui150.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame151.Name = "torch"
- Frame151.Parent = SurfaceGui150
- Frame151.Position = UDim2.new(0, -14, 0, -12)
- Frame151.Size = UDim2.new(0, 32, 0, 32)
- Frame151.BackgroundTransparency = 1
- Frame151.BorderSizePixel = 0
- Frame152.Parent = Frame151
- Frame152.Position = UDim2.new(0.5, 0, 0.5625, 0)
- Frame152.Size = UDim2.new(0.0625, 0, 0.4375, 0)
- Frame152.BackgroundColor = BrickColor.new("Cocoa")
- Frame152.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
- Frame152.BorderSizePixel = 0
- Frame153.Parent = Frame151
- Frame153.Position = UDim2.new(0.5, 0, 0.5, 0)
- Frame153.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame153.BackgroundColor = BrickColor.new("Dirt brown")
- Frame153.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
- Frame153.BorderSizePixel = 0
- Frame154.Parent = Frame151
- Frame154.Position = UDim2.new(0.4375, 0, 0.5, 0)
- Frame154.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame154.BackgroundColor = BrickColor.new("Bronze")
- Frame154.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
- Frame154.BorderSizePixel = 0
- Frame155.Parent = Frame151
- Frame155.Position = UDim2.new(0.4375, 0, 0.5625, 0)
- Frame155.Size = UDim2.new(0.0625, 0, 0.25, 0)
- Frame155.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame155.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame155.BorderSizePixel = 0
- Frame156.Parent = Frame151
- Frame156.Position = UDim2.new(0.4375, 0, 0.875, 0)
- Frame156.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame156.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame156.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame156.BorderSizePixel = 0
- Frame157.Parent = Frame151
- Frame157.Position = UDim2.new(0.4375, 0, 0.8125, 0)
- Frame157.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame157.BackgroundColor = BrickColor.new("Earth orange")
- Frame157.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame157.BorderSizePixel = 0
- Frame158.Parent = Frame151
- Frame158.Position = UDim2.new(0.4375, 0, 0.9375, 0)
- Frame158.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame158.BackgroundColor = BrickColor.new("Earth orange")
- Frame158.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame158.BorderSizePixel = 0
- Frame159.Parent = Frame151
- Frame159.Position = UDim2.new(0.5, 0, 0.4375, 0)
- Frame159.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame159.BackgroundColor = BrickColor.new("Institutional white")
- Frame159.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame159.BorderSizePixel = 0
- Frame160.Parent = Frame151
- Frame160.Position = UDim2.new(0.4375, 0, 0.4375, 0)
- Frame160.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame160.BackgroundColor = BrickColor.new("Light yellow")
- Frame160.BackgroundColor3 = Color3.new(1, 1, 0.592157)
- Frame160.BorderSizePixel = 0
- Frame161.Parent = Frame151
- Frame161.Position = UDim2.new(0.5, 0, 0.375, 0)
- Frame161.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame161.BackgroundColor = BrickColor.new("Deep orange")
- Frame161.BackgroundColor3 = Color3.new(1, 0.560784, 0)
- Frame161.BorderSizePixel = 0
- Frame162.Parent = Frame151
- Frame162.Position = UDim2.new(0.4375, 0, 0.375, 0)
- Frame162.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame162.BackgroundColor = BrickColor.new("New Yeller")
- Frame162.BackgroundColor3 = Color3.new(1, 0.847059, 0)
- Frame162.BorderSizePixel = 0
- SurfaceGui163.Parent = Part149
- SurfaceGui163.Face = Enum.NormalId.Right
- SurfaceGui163.ClipsDescendants = true
- SurfaceGui163.CanvasSize = Vector2.new(4, 20)
- SurfaceGui163.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame164.Name = "torch"
- Frame164.Parent = SurfaceGui163
- Frame164.Position = UDim2.new(0, -14, 0, -12)
- Frame164.Size = UDim2.new(0, 32, 0, 32)
- Frame164.BackgroundTransparency = 1
- Frame164.BorderSizePixel = 0
- Frame165.Parent = Frame164
- Frame165.Position = UDim2.new(0.5, 0, 0.5625, 0)
- Frame165.Size = UDim2.new(0.0625, 0, 0.4375, 0)
- Frame165.BackgroundColor = BrickColor.new("Cocoa")
- Frame165.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
- Frame165.BorderSizePixel = 0
- Frame166.Parent = Frame164
- Frame166.Position = UDim2.new(0.5, 0, 0.5, 0)
- Frame166.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame166.BackgroundColor = BrickColor.new("Dirt brown")
- Frame166.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
- Frame166.BorderSizePixel = 0
- Frame167.Parent = Frame164
- Frame167.Position = UDim2.new(0.4375, 0, 0.5, 0)
- Frame167.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame167.BackgroundColor = BrickColor.new("Bronze")
- Frame167.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
- Frame167.BorderSizePixel = 0
- Frame168.Parent = Frame164
- Frame168.Position = UDim2.new(0.4375, 0, 0.5625, 0)
- Frame168.Size = UDim2.new(0.0625, 0, 0.25, 0)
- Frame168.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame168.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame168.BorderSizePixel = 0
- Frame169.Parent = Frame164
- Frame169.Position = UDim2.new(0.4375, 0, 0.875, 0)
- Frame169.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame169.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame169.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame169.BorderSizePixel = 0
- Frame170.Parent = Frame164
- Frame170.Position = UDim2.new(0.4375, 0, 0.8125, 0)
- Frame170.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame170.BackgroundColor = BrickColor.new("Earth orange")
- Frame170.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame170.BorderSizePixel = 0
- Frame171.Parent = Frame164
- Frame171.Position = UDim2.new(0.4375, 0, 0.9375, 0)
- Frame171.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame171.BackgroundColor = BrickColor.new("Earth orange")
- Frame171.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame171.BorderSizePixel = 0
- Frame172.Parent = Frame164
- Frame172.Position = UDim2.new(0.5, 0, 0.4375, 0)
- Frame172.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame172.BackgroundColor = BrickColor.new("Institutional white")
- Frame172.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame172.BorderSizePixel = 0
- Frame173.Parent = Frame164
- Frame173.Position = UDim2.new(0.4375, 0, 0.4375, 0)
- Frame173.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame173.BackgroundColor = BrickColor.new("Light yellow")
- Frame173.BackgroundColor3 = Color3.new(1, 1, 0.592157)
- Frame173.BorderSizePixel = 0
- Frame174.Parent = Frame164
- Frame174.Position = UDim2.new(0.5, 0, 0.375, 0)
- Frame174.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame174.BackgroundColor = BrickColor.new("Deep orange")
- Frame174.BackgroundColor3 = Color3.new(1, 0.560784, 0)
- Frame174.BorderSizePixel = 0
- Frame175.Parent = Frame164
- Frame175.Position = UDim2.new(0.4375, 0, 0.375, 0)
- Frame175.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame175.BackgroundColor = BrickColor.new("New Yeller")
- Frame175.BackgroundColor3 = Color3.new(1, 0.847059, 0)
- Frame175.BorderSizePixel = 0
- SurfaceGui176.Parent = Part149
- SurfaceGui176.Face = Enum.NormalId.Left
- SurfaceGui176.ClipsDescendants = true
- SurfaceGui176.CanvasSize = Vector2.new(4, 20)
- SurfaceGui176.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame177.Name = "torch"
- Frame177.Parent = SurfaceGui176
- Frame177.Position = UDim2.new(0, -14, 0, -12)
- Frame177.Size = UDim2.new(0, 32, 0, 32)
- Frame177.BackgroundTransparency = 1
- Frame177.BorderSizePixel = 0
- Frame178.Parent = Frame177
- Frame178.Position = UDim2.new(0.5, 0, 0.5625, 0)
- Frame178.Size = UDim2.new(0.0625, 0, 0.4375, 0)
- Frame178.BackgroundColor = BrickColor.new("Cocoa")
- Frame178.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
- Frame178.BorderSizePixel = 0
- Frame179.Parent = Frame177
- Frame179.Position = UDim2.new(0.5, 0, 0.5, 0)
- Frame179.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame179.BackgroundColor = BrickColor.new("Dirt brown")
- Frame179.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
- Frame179.BorderSizePixel = 0
- Frame180.Parent = Frame177
- Frame180.Position = UDim2.new(0.4375, 0, 0.5, 0)
- Frame180.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame180.BackgroundColor = BrickColor.new("Bronze")
- Frame180.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
- Frame180.BorderSizePixel = 0
- Frame181.Parent = Frame177
- Frame181.Position = UDim2.new(0.4375, 0, 0.5625, 0)
- Frame181.Size = UDim2.new(0.0625, 0, 0.25, 0)
- Frame181.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame181.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame181.BorderSizePixel = 0
- Frame182.Parent = Frame177
- Frame182.Position = UDim2.new(0.4375, 0, 0.875, 0)
- Frame182.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame182.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame182.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame182.BorderSizePixel = 0
- Frame183.Parent = Frame177
- Frame183.Position = UDim2.new(0.4375, 0, 0.8125, 0)
- Frame183.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame183.BackgroundColor = BrickColor.new("Earth orange")
- Frame183.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame183.BorderSizePixel = 0
- Frame184.Parent = Frame177
- Frame184.Position = UDim2.new(0.4375, 0, 0.9375, 0)
- Frame184.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame184.BackgroundColor = BrickColor.new("Earth orange")
- Frame184.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame184.BorderSizePixel = 0
- Frame185.Parent = Frame177
- Frame185.Position = UDim2.new(0.5, 0, 0.4375, 0)
- Frame185.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame185.BackgroundColor = BrickColor.new("Institutional white")
- Frame185.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame185.BorderSizePixel = 0
- Frame186.Parent = Frame177
- Frame186.Position = UDim2.new(0.4375, 0, 0.4375, 0)
- Frame186.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame186.BackgroundColor = BrickColor.new("Light yellow")
- Frame186.BackgroundColor3 = Color3.new(1, 1, 0.592157)
- Frame186.BorderSizePixel = 0
- Frame187.Parent = Frame177
- Frame187.Position = UDim2.new(0.5, 0, 0.375, 0)
- Frame187.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame187.BackgroundColor = BrickColor.new("Deep orange")
- Frame187.BackgroundColor3 = Color3.new(1, 0.560784, 0)
- Frame187.BorderSizePixel = 0
- Frame188.Parent = Frame177
- Frame188.Position = UDim2.new(0.4375, 0, 0.375, 0)
- Frame188.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame188.BackgroundColor = BrickColor.new("New Yeller")
- Frame188.BackgroundColor3 = Color3.new(1, 0.847059, 0)
- Frame188.BorderSizePixel = 0
- SurfaceGui189.Parent = Part149
- SurfaceGui189.Face = Enum.NormalId.Back
- SurfaceGui189.ClipsDescendants = true
- SurfaceGui189.CanvasSize = Vector2.new(4, 20)
- SurfaceGui189.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame190.Name = "torch"
- Frame190.Parent = SurfaceGui189
- Frame190.Position = UDim2.new(0, -14, 0, -12)
- Frame190.Size = UDim2.new(0, 32, 0, 32)
- Frame190.BackgroundTransparency = 1
- Frame190.BorderSizePixel = 0
- Frame191.Parent = Frame190
- Frame191.Position = UDim2.new(0.5, 0, 0.5625, 0)
- Frame191.Size = UDim2.new(0.0625, 0, 0.4375, 0)
- Frame191.BackgroundColor = BrickColor.new("Cocoa")
- Frame191.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
- Frame191.BorderSizePixel = 0
- Frame192.Parent = Frame190
- Frame192.Position = UDim2.new(0.5, 0, 0.5, 0)
- Frame192.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame192.BackgroundColor = BrickColor.new("Dirt brown")
- Frame192.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
- Frame192.BorderSizePixel = 0
- Frame193.Parent = Frame190
- Frame193.Position = UDim2.new(0.4375, 0, 0.5, 0)
- Frame193.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame193.BackgroundColor = BrickColor.new("Bronze")
- Frame193.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
- Frame193.BorderSizePixel = 0
- Frame194.Parent = Frame190
- Frame194.Position = UDim2.new(0.4375, 0, 0.5625, 0)
- Frame194.Size = UDim2.new(0.0625, 0, 0.25, 0)
- Frame194.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame194.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame194.BorderSizePixel = 0
- Frame195.Parent = Frame190
- Frame195.Position = UDim2.new(0.4375, 0, 0.875, 0)
- Frame195.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame195.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame195.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame195.BorderSizePixel = 0
- Frame196.Parent = Frame190
- Frame196.Position = UDim2.new(0.4375, 0, 0.8125, 0)
- Frame196.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame196.BackgroundColor = BrickColor.new("Earth orange")
- Frame196.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame196.BorderSizePixel = 0
- Frame197.Parent = Frame190
- Frame197.Position = UDim2.new(0.4375, 0, 0.9375, 0)
- Frame197.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame197.BackgroundColor = BrickColor.new("Earth orange")
- Frame197.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame197.BorderSizePixel = 0
- Frame198.Parent = Frame190
- Frame198.Position = UDim2.new(0.5, 0, 0.4375, 0)
- Frame198.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame198.BackgroundColor = BrickColor.new("Institutional white")
- Frame198.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame198.BorderSizePixel = 0
- Frame199.Parent = Frame190
- Frame199.Position = UDim2.new(0.4375, 0, 0.4375, 0)
- Frame199.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame199.BackgroundColor = BrickColor.new("Light yellow")
- Frame199.BackgroundColor3 = Color3.new(1, 1, 0.592157)
- Frame199.BorderSizePixel = 0
- Frame200.Parent = Frame190
- Frame200.Position = UDim2.new(0.5, 0, 0.375, 0)
- Frame200.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame200.BackgroundColor = BrickColor.new("Deep orange")
- Frame200.BackgroundColor3 = Color3.new(1, 0.560784, 0)
- Frame200.BorderSizePixel = 0
- Frame201.Parent = Frame190
- Frame201.Position = UDim2.new(0.4375, 0, 0.375, 0)
- Frame201.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame201.BackgroundColor = BrickColor.new("New Yeller")
- Frame201.BackgroundColor3 = Color3.new(1, 0.847059, 0)
- Frame201.BorderSizePixel = 0
- SurfaceGui202.Parent = Part149
- SurfaceGui202.Face = Enum.NormalId.Top
- SurfaceGui202.ClipsDescendants = true
- SurfaceGui202.CanvasSize = Vector2.new(4, 4)
- SurfaceGui202.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame203.Name = "torch"
- Frame203.Parent = SurfaceGui202
- Frame203.Position = UDim2.new(0, -14, 0, -12)
- Frame203.Size = UDim2.new(0, 32, 0, 32)
- Frame203.BackgroundTransparency = 1
- Frame203.BorderSizePixel = 0
- Frame204.Parent = Frame203
- Frame204.Position = UDim2.new(0.5, 0, 0.5625, 0)
- Frame204.Size = UDim2.new(0.0625, 0, 0.4375, 0)
- Frame204.BackgroundColor = BrickColor.new("Cocoa")
- Frame204.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
- Frame204.BorderSizePixel = 0
- Frame205.Parent = Frame203
- Frame205.Position = UDim2.new(0.5, 0, 0.5, 0)
- Frame205.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame205.BackgroundColor = BrickColor.new("Dirt brown")
- Frame205.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
- Frame205.BorderSizePixel = 0
- Frame206.Parent = Frame203
- Frame206.Position = UDim2.new(0.4375, 0, 0.5, 0)
- Frame206.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame206.BackgroundColor = BrickColor.new("Bronze")
- Frame206.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
- Frame206.BorderSizePixel = 0
- Frame207.Parent = Frame203
- Frame207.Position = UDim2.new(0.4375, 0, 0.5625, 0)
- Frame207.Size = UDim2.new(0.0625, 0, 0.25, 0)
- Frame207.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame207.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame207.BorderSizePixel = 0
- Frame208.Parent = Frame203
- Frame208.Position = UDim2.new(0.4375, 0, 0.875, 0)
- Frame208.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame208.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame208.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame208.BorderSizePixel = 0
- Frame209.Parent = Frame203
- Frame209.Position = UDim2.new(0.4375, 0, 0.8125, 0)
- Frame209.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame209.BackgroundColor = BrickColor.new("Earth orange")
- Frame209.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame209.BorderSizePixel = 0
- Frame210.Parent = Frame203
- Frame210.Position = UDim2.new(0.4375, 0, 0.9375, 0)
- Frame210.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame210.BackgroundColor = BrickColor.new("Earth orange")
- Frame210.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame210.BorderSizePixel = 0
- Frame211.Parent = Frame203
- Frame211.Position = UDim2.new(0.5, 0, 0.4375, 0)
- Frame211.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame211.BackgroundColor = BrickColor.new("Institutional white")
- Frame211.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame211.BorderSizePixel = 0
- Frame212.Parent = Frame203
- Frame212.Position = UDim2.new(0.4375, 0, 0.4375, 0)
- Frame212.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame212.BackgroundColor = BrickColor.new("Light yellow")
- Frame212.BackgroundColor3 = Color3.new(1, 1, 0.592157)
- Frame212.BorderSizePixel = 0
- Frame213.Parent = Frame203
- Frame213.Position = UDim2.new(0.5, 0, 0.375, 0)
- Frame213.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame213.BackgroundColor = BrickColor.new("Deep orange")
- Frame213.BackgroundColor3 = Color3.new(1, 0.560784, 0)
- Frame213.BorderSizePixel = 0
- Frame214.Parent = Frame203
- Frame214.Position = UDim2.new(0.4375, 0, 0.375, 0)
- Frame214.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame214.BackgroundColor = BrickColor.new("New Yeller")
- Frame214.BackgroundColor3 = Color3.new(1, 0.847059, 0)
- Frame214.BorderSizePixel = 0
- SurfaceGui215.Parent = Part149
- SurfaceGui215.Face = Enum.NormalId.Bottom
- SurfaceGui215.ClipsDescendants = true
- SurfaceGui215.CanvasSize = Vector2.new(4, 4)
- SurfaceGui215.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame216.Name = "torch"
- Frame216.Parent = SurfaceGui215
- Frame216.Position = UDim2.new(0, -14, 0, -28)
- Frame216.Size = UDim2.new(0, 32, 0, 32)
- Frame216.BackgroundTransparency = 1
- Frame216.BorderSizePixel = 0
- Frame217.Parent = Frame216
- Frame217.Position = UDim2.new(0.5, 0, 0.5625, 0)
- Frame217.Size = UDim2.new(0.0625, 0, 0.4375, 0)
- Frame217.BackgroundColor = BrickColor.new("Cocoa")
- Frame217.BackgroundColor3 = Color3.new(0.235294, 0.184314, 0.109804)
- Frame217.BorderSizePixel = 0
- Frame218.Parent = Frame216
- Frame218.Position = UDim2.new(0.5, 0, 0.5, 0)
- Frame218.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame218.BackgroundColor = BrickColor.new("Dirt brown")
- Frame218.BackgroundColor3 = Color3.new(0.294118, 0.239216, 0.152941)
- Frame218.BorderSizePixel = 0
- Frame219.Parent = Frame216
- Frame219.Position = UDim2.new(0.4375, 0, 0.5, 0)
- Frame219.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame219.BackgroundColor = BrickColor.new("Bronze")
- Frame219.BackgroundColor3 = Color3.new(0.486275, 0.388235, 0.243137)
- Frame219.BorderSizePixel = 0
- Frame220.Parent = Frame216
- Frame220.Position = UDim2.new(0.4375, 0, 0.5625, 0)
- Frame220.Size = UDim2.new(0.0625, 0, 0.25, 0)
- Frame220.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame220.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame220.BorderSizePixel = 0
- Frame221.Parent = Frame216
- Frame221.Position = UDim2.new(0.4375, 0, 0.875, 0)
- Frame221.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame221.BackgroundColor = BrickColor.new("Red flip/flop")
- Frame221.BackgroundColor3 = Color3.new(0.584314, 0.458824, 0.27451)
- Frame221.BorderSizePixel = 0
- Frame222.Parent = Frame216
- Frame222.Position = UDim2.new(0.4375, 0, 0.8125, 0)
- Frame222.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame222.BackgroundColor = BrickColor.new("Earth orange")
- Frame222.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame222.BorderSizePixel = 0
- Frame223.Parent = Frame216
- Frame223.Position = UDim2.new(0.4375, 0, 0.9375, 0)
- Frame223.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame223.BackgroundColor = BrickColor.new("Earth orange")
- Frame223.BackgroundColor3 = Color3.new(0.403922, 0.321569, 0.192157)
- Frame223.BorderSizePixel = 0
- Frame224.Parent = Frame216
- Frame224.Position = UDim2.new(0.5, 0, 0.4375, 0)
- Frame224.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame224.BackgroundColor = BrickColor.new("Institutional white")
- Frame224.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame224.BorderSizePixel = 0
- Frame225.Parent = Frame216
- Frame225.Position = UDim2.new(0.4375, 0, 0.4375, 0)
- Frame225.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame225.BackgroundColor = BrickColor.new("Light yellow")
- Frame225.BackgroundColor3 = Color3.new(1, 1, 0.592157)
- Frame225.BorderSizePixel = 0
- Frame226.Parent = Frame216
- Frame226.Position = UDim2.new(0.5, 0, 0.375, 0)
- Frame226.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame226.BackgroundColor = BrickColor.new("Deep orange")
- Frame226.BackgroundColor3 = Color3.new(1, 0.560784, 0)
- Frame226.BorderSizePixel = 0
- Frame227.Parent = Frame216
- Frame227.Position = UDim2.new(0.4375, 0, 0.375, 0)
- Frame227.Size = UDim2.new(0.0625, 0, 0.0625, 0)
- Frame227.BackgroundColor = BrickColor.new("New Yeller")
- Frame227.BackgroundColor3 = Color3.new(1, 0.847059, 0)
- Frame227.BorderSizePixel = 0
- PointLight228.Parent = Part149
- PointLight228.Color = Color3.new(1, 0.937255, 0.780392)
- PointLight228.Range = 42
- PointLight228.Brightness = 0.60000002384186
- PointLight228.Shadows = true
- UnionOperation229.Name = "Chest"
- UnionOperation229.Parent = Folder0
- UnionOperation229.CFrame = CFrame.new(-5.96046448e-08, 1.36252606, -0.0937500596, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- UnionOperation229.Position = Vector3.new(-5.96046448e-08, 1.36252606, -0.0937500596)
- UnionOperation229.Color = Color3.new(0.215686, 0.192157, 0.152941)
- UnionOperation229.Size = Vector3.new(2.625, 2.62500024, 2.81250048)
- UnionOperation229.Anchored = true
- UnionOperation229.BrickColor = BrickColor.new("Earth green")
- UnionOperation229.Material = Enum.Material.SmoothPlastic
- UnionOperation229.brickColor = BrickColor.new("Earth green")
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = script
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- local blocksize = 3
- local viewdist = 4--3
- --- Fi
- local S_ReS = game.ReplicatedStorage
- local S_RS = game:GetService("RunService")
- local S_PS = game:GetService("PhysicsService")
- local S_UIS = game:GetService("UserInputService")
- local S_CAS = game:GetService("ContextActionService")
- local S_H = game:GetService("HttpService")
- local M_Ms = require(script:WaitForChild("MouseModule"))
- local M_F = require(script:WaitForChild("FontModule"))
- local M_BI = require(S_ReS:WaitForChild("AssetsMod"):WaitForChild("BlockInfo"))
- local M_II = require(S_ReS.AssetsMod:WaitForChild("ItemInfo"))
- local M_R = require(S_ReS.AssetsMod:WaitForChild("Recipes"))
- local D_B = script:WaitForChild("Blocks")
- local tex = require(S_ReS.AssetsMod:WaitForChild("Textures"))
- function createBlock()
- local block = Instance.new("Part")
- block.Size = Vector3.new(blocksize,blocksize,blocksize)
- block.Anchored = true
- return block
- end
- for name,info in pairs(M_BI) do
- if info.texture and (not info.customBlock) then
- if type(info.texture) == "table" then
- local bl = createBlock()
- for face,v in pairs(info.texture) do
- local d = Instance.new("Decal",bl)
- d.Face = face
- d.Texture = "rbxassetid://" .. tex[v]
- end
- if D_B:FindFirstChild(name) then
- D_B[name]:Destroy()
- end
- bl.Name = name
- bl.Parent = D_B
- else
- local bl = createBlock()
- for i,face in pairs(Enum.NormalId:GetEnumItems()) do
- local d = Instance.new("Decal",bl)
- d.Face = face
- --print(info.texture)
- d.Texture = "rbxassetid://" .. tex[info.texture]
- end
- if D_B:FindFirstChild(name) then
- D_B[name]:Destroy()
- end
- bl.Name = name
- bl.Parent = D_B
- end
- end
- end
- local sounds = {
- -- hurt
- ["hurt1"] = 3362337129,
- ["hurt2"] = 3362346832,
- ["hurt3"] = 3362346832,
- }
- local materialsounds = { -- just footstep sounds
- ["default"] = 507863857,
- ["stone"] = 507863857,
- ["wood"] = 507863857,--507863457,
- ["grass"] = 507863105,
- ["sand"] = 507863105,
- ["leaves"] = 507863105,
- ["dirt"] = 507864112,
- }
- local deb = { -- appears as particles when breaking a block
- ["GrassBlock"] = "dirt",
- ["Sand"] = "sand",
- ["Dirt"] = "dirt",
- ["Stone"] = "stone",
- ["Bedrock"] = "bedrock",
- ["OakPlanks"] = "planks",
- ["OakLog"] = "planks",
- ["Chest"] = "planks",
- ["CraftingTable"] = "planks",
- ["Glass"] = "glass",
- ["Leaves"] = "leaves",
- ["CoalBlock"] = "coalblock",
- ["IronBlock"] = "ironblock",
- ["DiamondBlock"] = "diamondblock",
- ["Obsidian"] = "obsidian"
- }
- local bds = { -- block destroy sounds
- ["GrassBlock"] = 379482039,
- ["Sand"] = 379482039,
- ["Dirt"] = 379482039,
- ["Leaves"] = 379482039,
- ["Stone"] = 507863457,
- ["Bedrock"] = 507863457,
- ["Glass"] = 2676503368
- }
- local blockinfo = {
- ["Glass"] = {
- closeValue = 0, -- determine if this block can hide a fully covered block (so we can save memory)
- useDefaultBDS = true
- },
- ["Leaves"] = {
- closeValue = 0
- },
- ["Torch"] = {
- closeValue = 0
- },
- ["Water"] = {
- closeValue = 0
- },
- ["Lava"] = {
- closeValue = 0
- },
- ["Chest"] = {
- closeValue = 0
- }
- }
- local fMaxDepth = { -- fluid max depth
- ["Water"] = 7,
- ["Lava"] = 3,
- }
- --- Vari ables
- local FX_P = script.Particle
- local plr = game.Players.LocalPlayer
- local char = plr.Character
- if not char or not char.Parent then
- char = plr.CharacterAdded:wait()
- end
- local sprinting = false
- local p_gui = plr:WaitForChild("PlayerGui")
- local p_bp = plr:WaitForChild("Backpack")
- local gui_hud = p_gui:WaitForChild("HUDGui")
- --local s_inv = char:WaitForChild("Inventory")
- --while #s_inv:GetChildren() < 45 do
- -- wait()
- --end
- local rmouse = plr:GetMouse()
- local mouse = M_Ms.new()
- local vblocks = Instance.new("Folder")
- vblocks.Name = "Blocks"
- vblocks.Parent = workspace
- local vliquid = Instance.new("Folder")
- vliquid.Name = "Fluid"
- vliquid.Parent = workspace
- local sbox = script.SelectionBox:Clone()
- sbox.Parent = workspace
- local L_CC = Instance.new("ColorCorrectionEffect")
- L_CC.Brightness = 0
- L_CC.Contrast = -.1
- L_CC.Saturation = -.2
- L_CC.Parent = game.Lighting
- local lastBreaking = nil
- local abreak = false
- local breaking = nil
- local breakTimer = 0
- local breakDTimer = 0
- local breakSTimer = 0
- local entities = {}
- local loadingChunks = {}
- local world = {}
- local flmt2 = {
- __index = function(t,i)
- local tb = {}
- t[i] = tb
- return tb
- end
- }
- local flmt = {
- __index = function(t,i)
- local tb = setmetatable({},flmt2)
- t[i] = tb
- return tb
- end
- }
- --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]
- local chCons = {}
- local bob_attack = 0
- --- Timers
- local sufftimer = 0.5
- local hurttimer = 10
- local voidtimer = 0
- ---
- local grounded = false
- local walkdist = 0
- local inWater = false
- ---
- local selSlot = 0
- local selSlotV = nil
- ---
- local tarPlayer = nil
- local tarBlock = nil
- local tarPos = Vector3.new()
- local tarDir = Vector3.new()
- local tarUsedBlock = nil
- ---
- local cHandle = {}
- local hcf_block = CFrame.new(0, -1.12699997, -1, 0.707106829, 0, 0.707106829, 0, 1, -0, -0.707106829, 0, 0.707106829)
- local hcf_tool = CFrame.new(0, -0.827000022, -1.15999997, 0, 0, -1.00000012, 0.707106769, 0.707106888, 0, 0.707106829, -0.707106769, 0)
- 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)
- local hs_block = Vector3.new(1.3,1.3,1.3)
- local hs_tool = Vector3.new(3,3,0.05)
- local hs_mat = Vector3.new(1.3,1.3,0.05)
- --- unused yet
- local E_size = Vector3.new(0.6,1.8,0.6)
- --local E_cPos = Vector3.new(0,10 * blocksize,0)
- local E_cVel = Vector3.new()
- ----- Math
- function lerp(a,b,t)
- return a + t * (b - a)
- end
- ----- Sound
- function playSound(pos,id,sp,v)
- local cx,cy = math.floor(pos.X/blocksize/16),math.floor(pos.Z/blocksize/16)
- if getChunk(cx,cy) then
- local att = Instance.new("Attachment")
- att.Position = pos
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://" .. id
- sound.PlaybackSpeed = sp or (1 + ((math.random()-.5)*.3))
- sound.Volume = v or .4
- sound.Parent = att
- att.Parent = workspace.Terrain
- game.Debris:AddItem(att,10)
- sound:Play()
- sound.Stopped:Connect(function()
- att:Destroy()
- end)
- return sound
- end
- end
- S_ReS.GameRemotes.PlaySound.OnClientEvent:Connect(playSound)
- ----- Misc Functions
- function getGamemode()
- local gamemode = char:FindFirstChild("Gamemode")
- if not gamemode then
- return 0
- else
- return gamemode.Value
- end
- end
- function reqDamage(dmg,dtype)
- if getGamemode() ~= 1 then
- S_ReS.GameRemotes.RequestDamage:FireServer(dmg,dtype)
- end
- end
- function getTimeFromSeconds(x)
- local cv = x >= 60
- local bv = x >= 60*60
- local av = x >= 60*60*24
- local a = 0
- local b = 0
- local c = 0
- local d = 0
- a = math.floor(x / 86400)
- b = math.floor((x % 86400) / 3600)
- c = math.floor((x % 3600) / 60)
- d = math.floor(x % 60)
- local e = tostring(a)
- local f = tostring(b)
- local g = tostring(c)
- local h = tostring(d)
- if f:len() == 1 then
- f = "0" .. f
- end
- if g:len() == 1 then
- g = "0" .. g
- end
- if h:len() == 1 then
- h = "0" .. h
- end
- if av then
- return e .. ":" .. f .. ":" .. g .. ":" .. h
- elseif bv then
- return tostring(b) .. ":" .. g .. ":" .. h
- elseif cv then
- return tostring(c) .. ":" .. h
- else
- return tostring(d)
- end
- end
- function getBlockModel(name)
- local block = D_B[name]
- block = block and block:Clone()
- return block
- end
- function getSurfacePosition2(a,b)
- local rp = b - a
- if math.abs(rp.X) > math.abs(rp.Z) then
- if rp.X > 0 then
- rp = Vector3.new(1,0,0)
- else
- rp = Vector3.new(-1,0,0)
- end
- return rp
- elseif math.abs(rp.Z) > math.abs(rp.X) then
- if rp.Z > 0 then
- rp = Vector3.new(0,0,1)
- else
- rp = Vector3.new(0,0,-1)
- end
- return rp
- end
- return rp
- end
- ----- Inventory
- local curIT = "default"
- local invOpen = false
- local g_slot = script.Slot:Clone()
- local g_slotna = script.SlotNA:Clone()
- local g_slotb = script.SlotB:Clone()
- local slotUFs = {}
- local slotUFs2 = {}
- local crafting = {}
- local craft_hand_vis = {}
- local craft_hand_link = { [80] = 1, [81] = 2, [82] = 4, [83] = 5 }
- local craft_table_link = { [80] = 1, [81] = 2, [82] = 3, [83] = 4, [84] = 5, [85] = 6, [86] = 7, [87] = 8, [88] = 9 }
- --local craft_hand_link_r = {}
- --for i,v in pairs(craft_hand_link) do
- -- craft_hand_link_r[v] = i
- --end
- local it_craftHand = {
- [80] = UDim2.new(0, 168,0, 44),
- [81] = UDim2.new(0, 204,0, 44),
- [82] = UDim2.new(0, 168,0, 80),
- [83] = UDim2.new(0, 204,0, 80),
- }
- local it_craftTab = {
- [80] = UDim2.new(0, 52,0, 26),
- [81] = UDim2.new(0, 88,0, 26),
- [82] = UDim2.new(0, 124,0, 26),
- [83] = UDim2.new(0, 52,0, 62),
- [84] = UDim2.new(0, 88,0, 62),
- [85] = UDim2.new(0, 124,0, 62),
- [86] = UDim2.new(0, 52,0, 98),
- [87] = UDim2.new(0, 88,0, 98),
- [88] = UDim2.new(0, 124,0, 98),
- }
- local extS = {}
- function switchIT(it)
- if it == "CraftingTable" then
- curIT = "crafting2"
- p_gui.HUDGui.Inventory.Crafting2.Visible = true
- p_gui.HUDGui.Inventory.Crafting.Visible = false
- p_gui.HUDGui.Inventory.Mirror.Visible = false
- p_gui.HUDGui.Inventory.Chest.Visible = false
- p_gui.HUDGui.Inventory.Furnace.Visible = false
- p_gui.HUDGui.Inventory.ResultSlot.Position = UDim2.new(0,240,0,62)
- p_gui.HUDGui.Inventory.ResultSlot.Visible = true
- for i=100,103 do
- local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
- s.Visible = false
- end
- for i=80,88 do
- local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
- --if i>=84 then
- s.Visible = true
- --end
- s.Position = it_craftTab[i]
- end
- elseif it == "Chest" then
- curIT = "chest"
- p_gui.HUDGui.Inventory.Crafting2.Visible = false
- p_gui.HUDGui.Inventory.Crafting.Visible = false
- p_gui.HUDGui.Inventory.Mirror.Visible = false
- p_gui.HUDGui.Inventory.Chest.Visible = true
- p_gui.HUDGui.Inventory.Furnace.Visible = false
- p_gui.HUDGui.Inventory.ResultSlot.Visible = false
- for i=100,103 do
- local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
- s.Visible = false
- end
- for i=80,88 do
- local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
- s.Visible = false
- end
- updateExternals()
- elseif it == "Furnace" then
- curIT = "furnace"
- p_gui.HUDGui.Inventory.Crafting2.Visible = false
- p_gui.HUDGui.Inventory.Crafting.Visible = false
- p_gui.HUDGui.Inventory.Mirror.Visible = false
- p_gui.HUDGui.Inventory.Chest.Visible = false
- p_gui.HUDGui.Inventory.Furnace.Visible = true
- p_gui.HUDGui.Inventory.ResultSlot.Visible = false
- for i=100,103 do
- local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
- s.Visible = false
- end
- for i=80,88 do
- local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
- s.Visible = false
- end
- updateExternals()
- else
- curIT = "default"
- p_gui.HUDGui.Inventory.Crafting.Visible = true
- p_gui.HUDGui.Inventory.Mirror.Visible = true
- p_gui.HUDGui.Inventory.Crafting2.Visible = false
- p_gui.HUDGui.Inventory.Chest.Visible = false
- p_gui.HUDGui.Inventory.Furnace.Visible = false
- p_gui.HUDGui.Inventory.ResultSlot.Position = UDim2.new(0,280,0,64)
- p_gui.HUDGui.Inventory.ResultSlot.Visible = true
- for i=100,103 do
- local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
- s.Visible = true
- end
- for i=80,88 do
- local s= p_gui.HUDGui.Inventory.Slots["Slot"..i]
- if i>=84 then
- s.Visible = false
- else
- s.Visible = true
- s.Position = it_craftHand[i]
- end
- end
- end
- end
- function updateExternals()
- if invOpen then
- local bl,ch = getBlock(tarUsedBlock.X,tarUsedBlock.Y,tarUsedBlock.Z)
- if bl and bl.name then
- if bl.name == "CraftingTable" then
- -- do something- oh wait
- elseif bl.name == "Furnace" then
- elseif bl.name == "Chest" then
- if bl.storage then
- for i=0,26 do
- extS[i] = bl.storage[i]
- end
- end
- updateExtVis()
- else
- tarUsedBlock = nil
- openInv()
- end
- else
- tarUsedBlock = nil
- openInv()
- end
- end
- end
- function updateExtVis()
- end
- function updateAllSlots()
- for _,v in pairs(slotUFs2) do
- v()
- end
- end
- function transItem(t1,t2,stack,count)
- --local t1 = S_H:JSONDecode(v1.Value)
- -- local t2 = S_H:JSONDecode(v2.Value)
- if stack and t1.name and (t1.count > 0) and t2.name and (t2.count > 0) and (t1.name == t2.name) then
- local item = M_II[t1.name]
- local stack = item and item.maxstack or 64
- local give = count and math.min(count,t1.count) or t1.count
- local fill = (stack - t2.count)
- local act = math.min(fill,give)
- t1.count = t1.count - act
- t2.count = t2.count + act
- return S_H:JSONEncode(t1),S_H:JSONEncode(t2)
- elseif stack and t1.name and (t1.count > 0) and (t2.count <= 0) then
- if t1.count == 1 then
- return S_H:JSONEncode(t2),S_H:JSONEncode(t1)
- else
- local t3 = {}
- for i,v in pairs(t1) do
- t3[i] = v
- end
- local item = M_II[t1.name]
- local stack = item and item.maxstack or 64
- local give = count and math.min(count,t1.count) or t1.count
- local fill = (stack - t2.count)
- local act = math.min(fill,give)
- t1.count = t1.count - act
- t3.count = act
- return S_H:JSONEncode(t1),S_H:JSONEncode(t3)
- end
- else
- return S_H:JSONEncode(t2),S_H:JSONEncode(t1)
- end
- end
- function moveItem(s1,s2,stack,count,e1,e2)
- local inv = s_inv
- local v1 = (not e1) and inv:FindFirstChild("Slot" .. s1)
- local v2 = (not e2) and inv:FindFirstChild("Slot" .. s2)
- --if v1 and v2 then
- --print("Ye")
- local t1 = (e1 and extS[s1]) or (v1 and S_H:JSONDecode(v1.Value))
- local t2 = (e2 and extS[s2]) or (v2 and S_H:JSONDecode(v2.Value))
- t1,t2 = transItem(t1,t2,stack,count)
- if e1 then
- extS[s1] = S_H:JSONEncode(t1)
- else
- v1.Value = S_H:JSONEncode(t1)
- end
- if e2 then
- extS[s2] = S_H:JSONEncode(t2)
- else
- v2.Value = S_H:JSONEncode(t2)
- end
- if e1 or e2 then updateExtVis() end
- --end
- game.ReplicatedStorage.GameRemotes.MoveItem:InvokeServer(s1,s2,stack,count,e1,e2,(e1 or e2) and (tarUsedBlock))
- updateExternals()
- slotUFs[s2]()
- end
- local resultSlot = nil
- local craftResult = nil
- function updateResult()
- local slot = resultSlot
- if not slot then
- resultSlot = g_slot:Clone()
- slot = resultSlot
- local sl = resultSlot
- sl.BackgroundColor3 = Color3.fromHSV(0,0,139/255)
- sl.Position = UDim2.new(0,2,0,2)
- M_F.linkLabel(sl.Count)
- M_F.linkLabel(sl.Shadow)
- --cslot.ZIndex = 5
- --sl.ZIndex = 5
- sl.MouseButton1Down:Connect(function()
- if craftResult and craftResult[1] then
- game.ReplicatedStorage.GameRemotes.CraftItems:InvokeServer((curIT == "crafting2") and tarUsedBlock)
- end
- end)
- sl.Parent = p_gui.HUDGui.Inventory.ResultSlot
- end
- local item = craftResult and craftResult[1]
- local count = craftResult and craftResult[2] or 0
- slot.Display:ClearAllChildren()
- slot.Count.Text = count
- slot.Shadow.Text = count
- slot.Count.Visible = count > 1
- slot.Shadow.Visible = count > 1
- local item = item and M_II[item]
- if item then
- if item.block then
- local sb = g_slotb:Clone()
- local bl = getBlockModel(item.block)
- bl.CFrame = CFrame.new() * CFrame.Angles(0,math.pi,0)
- for _,v in pairs(bl:GetChildren()) do
- if v:IsA("Decal") then
- if v.Face == Enum.NormalId.Front then
- v.Color3 = Color3.fromHSV(0,0,190/255)
- elseif v.Face == Enum.NormalId.Left then
- v.Color3 = Color3.fromHSV(0,0,140/255)
- end
- end
- end
- bl.Parent = sb
- sb.Parent = slot.Display
- else
- local tex = (script.ItemTextures:FindFirstChild(item.texture or "missing") or script.ItemTextures.missing):Clone()
- tex.Parent = slot.Display
- end
- --else
- --local tex = script.ItemTextures.missing:Clone()
- --tex.Parent = slot.Display
- end
- end
- function link(slot,val,id,uf)
- local lastname = nil
- local lastcount = 0
- local function update(new)
- local tab = S_H:JSONDecode(new or val.Value)
- local count = tab.count
- if (count ~= lastcount) or (tab.name ~= lastname) then
- lastname = tab.name
- lastcount = count
- slot.Display:ClearAllChildren()
- slot.Count.Text = count
- slot.Shadow.Text = count
- slot.Count.Visible = count > 1
- slot.Shadow.Visible = count > 1
- --end
- if count and (count > 0) and tab.name then
- local item = M_II[tab.name]
- if item then
- if item.block then
- local sb = g_slotb:Clone()
- local bl = getBlockModel(item.block)
- bl.CFrame = CFrame.new() * CFrame.Angles(0,math.pi*-.5,0)
- for _,v in pairs(bl:GetChildren()) do
- if v:IsA("Decal") then
- if v.Face == Enum.NormalId.Right then
- v.Color3 = Color3.fromHSV(0,0,190/255)
- elseif v.Face == Enum.NormalId.Front then
- v.Color3 = Color3.fromHSV(0,0,140/255)
- end
- end
- end
- bl.Parent = sb
- sb.Parent = slot.Display
- else
- local tex = (script.ItemTextures:FindFirstChild(item.texture or "missing") or script.ItemTextures.missing):Clone()
- tex.Parent = slot.Display
- end
- else
- local tex = script.ItemTextures.missing:Clone()
- tex.Parent = slot.Display
- end
- end
- if (id >= 80) and (id <= 88) then
- local existence = false
- local tab = {
- }
- local linker = (curIT == "crafting2") and craft_table_link or craft_hand_link
- if (curIT == "crafting2") then
- for i=80,88 do
- local it = S_H:JSONDecode(s_inv["Slot"..i].Value)
- tab[craft_table_link[i]] = (it.count > 0) and it.name
- if (it.count > 0) and it.name then existence = true end
- end
- else
- for i=80,83 do
- local it = S_H:JSONDecode(s_inv["Slot"..i].Value)
- tab[craft_hand_link[i]] = (it.count > 0) and it.name
- if (it.count > 0) and it.name then existence = true end
- end
- end
- if existence then
- while not (tab[1] or tab[2] or tab[3]) do
- tab[1] = tab[4]; tab[4] = tab[7]; tab[7] = nil
- tab[2] = tab[5]; tab[5] = tab[8]; tab[8] = nil
- tab[3] = tab[6]; tab[6] = tab[9]; tab[9] = nil
- end
- while not (tab[1] or tab[4] or tab[7]) do
- tab[1] = tab[2]; tab[2] = tab[3]; tab[3] = nil
- tab[4] = tab[5]; tab[5] = tab[6]; tab[6] = nil
- tab[7] = tab[8]; tab[8] = tab[9]; tab[9] = nil
- end
- local result = nil
- for i,v in pairs(M_R[1]) do
- local correct = true
- for a=1,9 do
- local actual = tab[a]
- if not actual then
- actual = nil -- Lua
- end
- if actual ~= v[a] then
- correct = false
- end
- end
- if correct then
- result = {i,v[10]}
- break
- end
- end
- craftResult = result
- updateResult()
- else
- craftResult = nil
- updateResult()
- end
- end
- end
- end
- table.insert(chCons,val.Changed:Connect(update))
- if uf then slotUFs[id] = update end
- table.insert(slotUFs2,update)
- update(val.Value)
- end
- function loadInventory()
- p_gui:WaitForChild("HUDGui"):WaitForChild("Hotbar")
- p_gui.HUDGui:WaitForChild("Inventory"):WaitForChild("Slots")
- p_gui.HUDGui.Inventory:WaitForChild("Mirror")
- wait()
- slotUFs = {}
- slotUFs2 = {}
- resultSlot = nil
- --
- local moriginslot = nil
- for i,v in pairs(s_inv:GetChildren()) do
- local i = tonumber(v.Name:sub(5))
- if (i<100) and (i>=-1) then
- if (i>=0) and (i<=8) then
- local sl = g_slot:Clone()
- sl.Position = UDim2.new(0,6 + 40*i,0,6)
- M_F.linkLabel(sl.Count)
- M_F.linkLabel(sl.Shadow)
- sl.MouseButton1Click:Connect(function()
- setSelSlot(i)
- end)
- sl.Parent = p_gui.HUDGui.Hotbar
- link(sl,v,i)
- end
- local cslot = p_gui.HUDGui.Inventory.Slots:FindFirstChild("Slot" .. i)
- if cslot then
- local sl = (i==-1) and g_slotna:Clone() or g_slot:Clone()
- sl.BackgroundColor3 = Color3.fromHSV(0,0,139/255)
- sl.Position = UDim2.new(0,2,0,2)
- M_F.linkLabel(sl.Count)
- M_F.linkLabel(sl.Shadow)
- if i==-1 then
- --sl.Selectable = false
- --sl.Active = false
- table.insert(chCons,S_RS.RenderStepped:Connect(function()
- cslot.Position = UDim2.new(0,rmouse.X - cslot.Parent.AbsolutePosition.X - 18,0,rmouse.Y - cslot.Parent.AbsolutePosition.Y - 18)
- end))
- else
- --cslot.ZIndex = 5
- --sl.ZIndex = 5
- local function swap()
- if not invOpen then return end
- local v2 = s_inv["Slot-1"]
- local tab = S_H:JSONDecode(v2.Value) -- Holding slot item
- local tab2 = S_H:JSONDecode(v.Value) -- Selecting slot item
- local exist1 = tab and tab.name and (tab.count > 0) -- if the cursor is holding something
- local exist2 = tab2 and tab2.name and (tab2.count > 0) -- if the selected slot is holding something
- -- local count = tab and tab.count
- -- if count then
- -- for _,v in pairs(crafting) do
- -- if v.originslot and (v.originslot == i) then
- -- count = count - v.count
- -- end
- -- end
- -- end
- if exist1 or exist2 then
- if not exist1 then
- moriginslot = i
- moveItem(i,-1)
- else
- if exist2 then
- moriginslot = i
- else
- moriginslot = nil
- end
- moveItem(-1,i,true)
- end
- end
- --if exist1 and exist2 then
- -- v.Value = tab
- -- v2.Value = tab2
- --
- --end
- end
- local function putDownSingle()
- if not invOpen then return end
- local v2 = s_inv["Slot-1"]
- local tab = S_H:JSONDecode(v2.Value) -- Holding slot item
- local tab2 = S_H:JSONDecode(v.Value) -- Selecting slot item
- local exist1 = tab and tab.name and (tab.count > 0) -- if the cursor is holding something
- local exist2 = tab2 and tab2.name and (tab2.count > 0) -- if the selected slot is holding something
- if exist1 then
- moriginslot = i
- moveItem(-1,i,true,1)
- end
- --if exist1 and exist2 then
- -- v.Value = tab
- -- v2.Value = tab2
- --
- --end
- end
- sl.MouseButton1Down:Connect(swap)
- sl.MouseButton2Down:Connect(putDownSingle)
- sl.MouseEnter:Connect(function()
- sl.Highlight.BackgroundTransparency = 0.75
- if invOpen and S_UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) then
- putDownSingle()
- end
- end)
- sl.MouseLeave:Connect(function()
- sl.Highlight.BackgroundTransparency = 1
- end)
- end
- sl.Parent = cslot
- link(sl,v,i,true)
- end
- end
- end
- -- Crafting
- -- Mirror
- char.Archivable =true
- local charc = char:Clone()
- for _,v in pairs(charc:GetChildren()) do
- if v:IsA("Script") or v:IsA("Folder") then
- v:Destroy()
- end
- end
- char.Archivable =false
- table.insert(chCons,char.ChildAdded:Connect(function(v)
- if not (v:IsA("Script") or v:IsA("Folder")) then
- v:Clone().Parent = charc
- end
- end))
- charc.Parent = p_gui.HUDGui.Inventory.Mirror.VPFrame
- charc.PrimaryPart = charc.HumanoidRootPart
- charc:SetPrimaryPartCFrame(CFrame.new(0,.25,0))
- charc.Name = ""
- charc.Humanoid.BreakJointsOnDeath = false
- charc.Humanoid.NameDisplayDistance = 0
- charc.HumanoidRootPart.Anchored = true
- table.insert(chCons,S_RS.RenderStepped:Connect(function()
- if invOpen and p_gui.HUDGui.Inventory.Mirror.Visible then
- local apos = p_gui.HUDGui.Inventory.Mirror.VPFrame.AbsolutePosition + (p_gui.HUDGui.Inventory.Mirror.VPFrame.AbsoluteSize/2)
- local offset = Vector2.new(rmouse.X - apos.X,rmouse.Y - apos.Y)
- --charc.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(0,1.7,0),Vector3.new(offset.X,0,-50 + offset.Y))
- charc:SetPrimaryPartCFrame(CFrame.new(Vector3.new(0,.25,0),Vector3.new(-math.tanh(offset.X/65)*45,-offset.Y/35,-50)))
- 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)
- end
- end))
- end
- function updateSelSlot()
- if s_inv then
- p_gui.HUDGui.Hotbar.Selector.Position = UDim2.new(0,-2 + (selSlot * 40),0,-2)
- selSlotV = s_inv["Slot"..selSlot]
- game.ReplicatedStorage.GameRemotes.ChangeSlot:InvokeServer(selSlot)
- end
- end
- function changeSelSlot(inc)
- if s_inv then
- selSlot = (selSlot + inc)%9
- updateSelSlot()
- end
- end
- function setSelSlot(i)
- selSlot = i
- updateSelSlot()
- end
- function openInv(it)
- invOpen = not invOpen
- if invOpen then
- switchIT(it)
- end
- updateAllSlots()
- p_gui.HUDGui.Overshadow.Visible = invOpen
- p_gui.HUDGui.Inventory.Visible = invOpen
- if not invOpen then
- local function rep(i)
- local tab = S_H:JSONDecode(s_inv["Slot"..i].Value)
- if tab and (tab.count > 0) then
- game.ReplicatedStorage.GameRemotes.SortItem:InvokeServer(i)
- end
- end
- rep(-1)
- for i=80,88 do
- rep(i)
- end
- end
- end
- function toggleInv(aName,state)
- if (not state) or (state and (state == Enum.UserInputState.Begin)) then
- openInv()
- end
- end
- ----- Health
- local g_heart = script.Heart:Clone()
- function linkHealth(human)
- local shaking = false
- local ping_dmg = 0
- local ping_heal = 0
- local h_wol = false
- local lastHealth = human.Health
- local lastVHealth = math.ceil(lastHealth/5)
- p_gui:WaitForChild("HUDGui"):WaitForChild("Hotbar"):WaitForChild("HealthBar")
- wait()
- local htab = {}
- for i=1,10 do
- local heart = g_heart:Clone()
- heart.Position = UDim2.new(0,16*(i-1),0,0)
- heart.Parent = p_gui.HUDGui.Hotbar.HealthBar
- htab[i] = heart
- end
- local function update(new)
- local change = new - lastHealth
- lastHealth = new
- local changeL = math.ceil(new/5) - lastVHealth
- lastVHealth = math.ceil(lastHealth/5)
- if (change < 0) then
- hurttimer = 0
- ping_dmg = 0
- elseif (changeL > 0) then
- ping_heal = 0
- end
- for i,v in pairs(htab) do
- local left = lastVHealth >= (i*2 - 1)
- local right = lastVHealth >= (i*2)
- -- left half
- v.ImageColor3 = right and Color3.new(1, 19/255, 19/255) or Color3.fromHSV(0,0,40/255)
- v.Half.Visible = left
- end
- end
- human.HealthChanged:Connect(update)
- update(human.Health)
- pcall(S_RS.UnbindFromRenderStep,S_RS,"health")
- S_RS:BindToRenderStep("health",Enum.RenderPriority.Character.Value + 1,function(dt)
- if p_gui:FindFirstChild("HUDGui") then
- if (human.Health ~= math.huge) and (getGamemode() ~= 1) then
- p_gui.HUDGui.Hotbar.HealthBar.Visible = true
- if lastVHealth <= 4 then
- shaking = true
- if shaking then
- for i,v in pairs(htab) do
- if math.random(1,3) == 2 then
- v.Position = UDim2.new(0,16*(i-1),0,math.random(0,1)*2)
- end
- end
- else
- for i,v in pairs(htab) do
- v.Position = UDim2.new(0,16*(i-1),0,math.random(0,1)*2)
- end
- end
- elseif (lastVHealth > 4) and shaking then
- shaking = false
- for i,v in pairs(htab) do
- v.Position = UDim2.new(0,16*(i-1),0,0)
- end
- end
- if ping_dmg < ping_heal then
- if ((ping_dmg) <= .9) and ((ping_dmg%0.3) < .15) and (not h_wol) then
- h_wol = true
- for _,v in pairs(p_gui.HUDGui.Hotbar.HealthBar:GetChildren()) do
- v.Outline.ImageColor3 = Color3.new(1,1,1)
- end
- elseif (((ping_dmg) > .9) or ((ping_dmg%0.3) > .15)) and h_wol then
- h_wol = false
- for _,v in pairs(p_gui.HUDGui.Hotbar.HealthBar:GetChildren()) do
- v.Outline.ImageColor3 = Color3.new(0,0,0)
- end
- end
- else
- if ((ping_heal + 0.08) <= .6) and (((ping_heal + 0.08)%0.3) < .15) and (not h_wol) then
- h_wol = true
- for _,v in pairs(p_gui.HUDGui.Hotbar.HealthBar:GetChildren()) do
- v.Outline.ImageColor3 = Color3.new(1,1,1)
- end
- elseif (((ping_heal + 0.08) > .6) or (((ping_heal + 0.08)%0.3) > .15)) and h_wol then
- h_wol = false
- for _,v in pairs(p_gui.HUDGui.Hotbar.HealthBar:GetChildren()) do
- v.Outline.ImageColor3 = Color3.new(0,0,0)
- end
- end
- end
- else
- p_gui.HUDGui.Hotbar.HealthBar.Visible = false
- end
- end
- ping_dmg = math.clamp(ping_dmg + dt,0,10)
- ping_heal = math.clamp(ping_heal + dt,0,10)
- end)
- end
- ----- Entities
- function updateEntities(dt)
- for i,v in pairs(entities) do
- if not (i.Parent == workspace.Entities) then
- if v.part then
- v.part:Destroy()
- end
- entities[i] = nil
- end
- end
- for _,v in pairs(workspace.Entities:GetChildren()) do
- local ent = entities[v]
- local dat = S_H:JSONDecode(v.Value)
- if not ent then
- ent = {
- spawned = time(),
- lastSPos = Vector3.new(unpack(dat.pos)),
- pos = Vector3.new(unpack(dat.pos)),
- vel = Vector3.new(unpack(dat.pos)),
- oSize = Vector3.new(),
- data = dat
- }
- entities[v] = ent
- if v.Name == "item" then
- local name = dat.name
- local item = M_II[name]
- local part = nil
- if item then
- if item.block then
- local block = getBlockModel(item.block)
- if block then
- block = block:Clone()
- block.Size = Vector3.new(.61,.61,.61)
- ent.oSize = block.Size
- block.CanCollide = false
- block.Anchored = true
- part = block
- end
- end
- if not part then
- local tex = (script.ItemTextures:FindFirstChild(item.texture or "missing") or script.ItemTextures.missing):Clone()
- local sgp = Instance.new("Part")
- sgp.Size = Vector3.new(1.2,1.2,0.05)
- ent.oSize = sgp.Size
- sgp.Transparency = 1
- sgp.CanCollide = false
- sgp.Anchored = true
- local sgui = Instance.new("SurfaceGui")
- sgui.CanvasSize = Vector2.new(32,32)
- sgui.Face = Enum.NormalId.Front
- sgui.LightInfluence = 1
- tex:Clone().Parent = sgui
- local sgui2 = Instance.new("SurfaceGui")
- sgui2.CanvasSize = Vector2.new(32,32)
- sgui2.Face = Enum.NormalId.Back
- sgui2.LightInfluence = 1
- tex.Parent = sgui2
- sgui.Parent = sgp
- sgui2.Parent = sgp
- part = sgp
- end
- end
- if part then
- part.Parent = workspace
- ent.part = part
- end
- end
- end
- if v.Name == "item" then
- if dat.fadeTo then
- if not ent.fadeTo then
- ent.fadeTo = dt
- else
- ent.fadeTo = ent.fadeTo + dt
- end
- end
- if ent.part then
- local spos = Vector3.new(unpack(dat.pos))
- if spos ~= ent.lastSPos then
- ent.lastSPos = spos
- ent.pos = spos
- ent.vel = Vector3.new(unpack(dat.vel))
- end
- local pos = ent.pos--Vector3.new(unpack(dat.pos))
- local dist = (pos - workspace.CurrentCamera.CFrame.Position).Magnitude
- if dist < (viewdist*16) then
- if ent.fadeTo then
- pos = pos:Lerp(Vector3.new(unpack(dat.fadeTo)),math.min(1,ent.fadeTo*10))
- if (ent.fadeTo*10) > 1 then
- ent.part.Parent = nil
- else
- ent.part.Size = ent.oSize * (1-math.min(1,ent.fadeTo*10))
- ent.part.Parent = workspace
- end
- else
- ent.part.Parent = workspace
- end
- 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)
- else
- ent.part.Parent = nil
- end
- local vel = ent.vel
- if (not ent.fadeTo) and (dist < (blocksize*8)) then
- pos = pos + (vel*dt)
- vel = vel + Vector3.new(0,-16*blocksize * dt,0)
- local pos2 = Vector3.new(pos.X,pos.Y - 0.82,pos.Z)
- local rx2,ry2,rz2 = PtoT(pos)
- local rx,ry,rz = PtoT(pos2)
- local bl2,ch2 = getBlock(rx2,ry2,rz2)
- local bl,ch = getBlock(rx,ry,rz)
- if bl2 and bl2.name then
- local dpos = Vector3.new(rx2,ry2,rz2)*blocksize - pos
- --pos = Vector3.new(pos.X,(ry2*blocksize)+blocksize/2+.1,pos.Z) - dpos/2
- pos = Vector3.new(pos.X,pos.Y,pos.Z) - dpos/2
- vel = Vector3.new(vel.X*.2,1,vel.Z*.2)
- elseif bl and bl.name then
- pos = Vector3.new(pos.X,(ry*blocksize)+blocksize/2+.8,pos.Z)
- vel = Vector3.new(vel.X*0.6,0,vel.Z*0.6)
- end
- end
- ent.pos = pos
- ent.vel = vel
- end
- end
- end
- end
- local cHandle = {}
- function updatePlayers()
- local nulr = {}
- for i,v in pairs(cHandle) do
- if not i:IsDescendantOf(workspace) then
- if v[1] then
- v[1]:Destroy()
- end
- table.insert(nulr,i)
- end
- end
- for _,v in pairs(nulr) do
- cHandle[v] = nil
- end
- for _,v in pairs(game.Players:GetPlayers()) do
- if (v ~= game.Players.LocalPlayer) then
- pcall(function()
- local ch = v.Character
- local htorso = ch and ch:FindFirstChild("HumanoidRootPart")
- if htorso then
- if v.Character:FindFirstChild("Right Arm") then
- if not cHandle[v.Character] then
- cHandle[v.Character] = {}
- end
- local ch = cHandle[v.Character]
- local cname = nil
- local inv = v.Character:FindFirstChild("Inventory")
- local ss = v.Character:FindFirstChild("SelectedSlot")
- if inv and ss then
- local val = inv:FindFirstChild("Slot" .. ss.Value)
- if val then
- local tab = S_H:JSONDecode(val.Value)
- if tab and tab.name and (tab.count > 0) then
- cname = tab.name
- end
- end
- end
- if ch[2] ~= cname then
- ch[2] = cname
- if ch[1] then
- ch[1]:Destroy()
- end
- if ch[2] then
- local item = M_II[ch[2]]
- local part = nil
- local partt = 0
- if item then
- if item.block then
- local block = getBlockModel(item.block)
- if block then
- block = block:Clone()
- block.Size = hs_block
- block.CanCollide = false
- block.Anchored = true
- part = block
- partt = 2
- end
- end
- if not part then
- local tex = (script.ItemTextures:FindFirstChild(item.texture or "missing") or script.ItemTextures.missing):Clone()
- local sgp = Instance.new("Part")
- sgp.Size = hs_mat
- sgp.Transparency = 1
- sgp.CanCollide = false
- sgp.Anchored = true
- local sgui = Instance.new("SurfaceGui")
- sgui.CanvasSize = Vector2.new(32,32)
- sgui.Face = Enum.NormalId.Front
- sgui.LightInfluence = 1
- tex:Clone().Parent = sgui
- local sgui2 = Instance.new("SurfaceGui")
- sgui2.CanvasSize = Vector2.new(32,32)
- sgui2.Face = Enum.NormalId.Back
- sgui.LightInfluence = 1
- tex.Parent = sgui2
- sgui.Parent = sgp
- sgui2.Parent = sgp
- part = sgp
- partt = 1
- end
- end
- if part then
- local hcf = nil
- if partt == 3 then
- hcf = hcf_tool
- elseif partt == 2 then
- hcf = hcf_block
- else
- hcf = hcf_mat
- end
- part.Massless = true
- part.Anchored = false
- part.CFrame = v.Character["Right Arm"].CFrame * hcf
- local wc = Instance.new("WeldConstraint")
- wc.Part0 = v.Character["Right Arm"]
- wc.Part1 = part
- wc.Parent = part
- part.Parent = v.Character
- ch[1] = part
- end
- end
- end
- end
- end
- end)
- end
- end
- end
- S_RS:BindToRenderStep("eloop",Enum.RenderPriority.Camera.Value + 1,updateEntities)
- S_RS:BindToRenderStep("ploop",Enum.RenderPriority.Camera.Value + 1,updatePlayers)
- ----- Chunks & Blocks
- function getChunk(x,y)
- return world[x] and world[x][y]
- end
- function getBlock(x,y,z)
- local pos = Vector3.new(math.floor(x + .5),math.floor(y + .5),math.floor(z + .5))
- local pos2 = Vector3.new(pos.X%16,pos.Y,pos.Z%16)
- local chunk = getChunk(math.floor(pos.X/16),math.floor(pos.Z/16))
- return chunk and chunk[pos2.X] and chunk[pos2.X][pos2.Y] and chunk[pos2.X][pos2.Y][pos2.Z], chunk
- --local chunk = getChunk(math.floor(math.floor(x + .5)/16),math.floor(math.floor(z + .5)/16))
- --local inf = chunk and fastlink[x][y][z]
- --if inf and (inf[2] == chunk) then
- -- return inf[1],inf[2]
- --else
- -- return nil,chunk
- --end
- end
- function PtoT(x,y,z)
- if type(x) == "userdata" then
- x,y,z = x.X,x.Y,x.Z
- end
- return math.floor(x/blocksize + .5),math.floor(y/blocksize + .5),math.floor(z/blocksize + .5)
- end
- ---
- function destroyBlock(x,y,z)
- local bl,ch = getBlock(x,y,z)
- if bl and bl.name then
- local name = bl.name
- ch.change(x%16,y,z%16)
- playSound(Vector3.new(x,y,z)*blocksize,bds[name] or 507863457)
- local bi = M_BI[name]
- if bi and not (bi.blocktype == "nonsolid") then
- for i=1,40 do -- create debris particles
- local p = FX_P:Clone()
- p.CFrame = CFrame.new(Vector3.new(x,y,z)*blocksize + Vector3.new((math.random()-.5)*blocksize,(math.random()-.5)*blocksize,(math.random()-.5)*blocksize))
- p.Velocity = Vector3.new((math.random()-.5)*9,math.random()*6 + 6,(math.random()-.5)*9)
- p.BGui.ImageLabel.Image = "http://www.roblox.com/Thumbs/Asset.ashx?width=420&height=420&assetId=" .. (tex[deb[name]] or "75880927")
- p.BGui.ImageLabel.ImageRectOffset = Vector2.new(math.random(0,360),math.random(0,360))
- local r= math.random()
- p.BGui.Size = UDim2.new(0.3 + r*.25,0,0.3 + r*.25,0)
- p.Parent = workspace.CurrentCamera
- p.CollisionGroupId = S_ReS.PhyGroups.Particles.Value
- game.Debris:AddItem(p,math.random()*2)
- end
- end
- end
- end
- function breakBlock(x,y,z,force)
- if (y < 0) or (y > 255) then return end
- local bl,ch = getBlock(x,y,z)
- if bl and bl.name then
- coroutine.resume(coroutine.create(function() S_ReS.GameRemotes.BreakBlock:InvokeServer(x,y,z,force) end))
- if getGamemode() ~= 1 then
- breaking = Vector3.new(x,y,z)
- local curBreaking = breaking
- local obtainable = true
- local inf = M_BI[bl.name]
- if inf and inf.toolRequire then
- obtainable = false
- end
- breakTimer = (inf and inf.hardness or 1) * (obtainable and 1.5 or 5)
- else
- destroyBlock(x,y,z)
- end
- --wait(2)
- end
- end
- function cancelBlock(x,y,z)
- breaking = nil
- S_ReS.GameRemotes.CancelBlock:InvokeServer(x,y,z)
- end
- function placeBlockFS(x,y,z,name,dat,silent)
- if (y < 0) or (y > 255) then return end
- local bl,ch = getBlock(x,y,z)
- if ch then
- --if not (bl and bl.name) then
- local bi = name and M_BI[name]
- --local useDefBDS = true
- --if info and (not info.useDefaultBDS) then
- --useDefBDS = false
- --end
- if name and (not silent) then
- playSound(Vector3.new(x,y,z)*blocksize,materialsounds[bi and bi.material or "default"] or materialsounds["default"])--(not useDefBDS) and bds[name] or 507863457)
- end
- ch.change(x%16,y,z%16,name,dat)
- end
- end
- function placeBlock(x,y,z,slot,nor,ignchar)
- if (y < 0) or (y > 255) then return end
- local htorso = char and char:FindFirstChild("HumanoidRootPart")
- if htorso then
- local top = (not ignchar) and Vector3.new(PtoT(htorso.Position.X,htorso.Position.Y + 1,htorso.Position.Z))
- local bottom = (not ignchar) and Vector3.new(PtoT(htorso.Position.X,htorso.Position.Y - 2,htorso.Position.Z))
- if ignchar or ((top ~= Vector3.new(x,y,z)) and (bottom ~= Vector3.new(x,y,z))) then
- local bl,ch = getBlock(x,y,z)
- local exist = bl and bl.name
- local inf = exist and M_BI[exist]
- if ch and (not exist) or (inf and (inf.blocktype == "fluid")) then
- local sv = s_inv["Slot" .. slot]
- local tab = S_H:JSONDecode(sv.Value)
- if tab and (tab.count > 0) then
- local iinf = tab.name and M_II[tab.name]
- local name = tab.name
- --local info = blockinfo[name]
- --local useDefBDS = true
- --if info and (not info.useDefaultBDS) then
- -- useDefBDS = false
- --end
- --playSound(Vector3.new(x,y,z)*blocksize,(not useDefBDS) and bds[name] or 507863457)
- local bi = M_BI[name]
- playSound(Vector3.new(x,y,z)*blocksize,materialsounds[bi and bi.material or "default"] or materialsounds["default"])
- local nid = 0
- if not iinf.placeable then nor = getSurfacePosition2(Vector3.new(x,y,z)*3,workspace.CurrentCamera.CFrame.Position) end
- if nor == Vector3.new(0,1,0) then
- nid = 5
- elseif nor == Vector3.new(1,0,0) then
- nid = 1
- elseif nor == Vector3.new(-1,0,0) then
- nid = 2
- elseif nor == Vector3.new(0,0,1) then
- nid = 3
- elseif nor == Vector3.new(0,0,-1) then
- nid = 4
- end
- print(nid)
- ch.change(x%16,y,z%16,name,{
- facing = nid
- })
- if getGamemode() ~= 1 then
- tab.count = tab.count - 1
- sv.Value = S_H:JSONEncode(tab)
- end
- local ok,name = S_ReS.GameRemotes.PlaceBlock:InvokeServer(x,y,z,slot,nor) -- send request to place block xyz as name to server
- if not ok then
- ch.change(x%16,y,z%16,name) -- if unsuccessful, change back to name given by server or air
- end
- end
- end
- end
- end
- end
- function updateBlock(x,y,z,dat)
- if (y < 0) or (y > 255) then return end
- local bl,ch = getBlock(x,y,z)
- if bl and bl.name then
- ch.update(x%16,y,z%16,dat)
- end
- end
- ---
- function totalClosure(block)
- local close = block.closure or 0
- if block.exclosure and (block.exclosure>0) then
- close = close + 1
- end
- if block.eyclosure and (block.eyclosure>0) then
- close = close + 1
- end
- return close
- end
- function createChunk(cx,cy)
- local chunk = {}
- chunk.vfold = Instance.new("Folder")
- chunk.vfold.Name = cx .. "x" .. cy
- chunk.vlfold = Instance.new("Folder")
- chunk.vlfold.Name = "L" .. cx .. "x" .. cy
- spawn(function()
- pcall(function() chunk.vlfold.Parent = vliquid end)
- end)
- chunk.visualize = function(x,y,z)
- local exist = chunk[x] and chunk[x][y] and chunk[x][y][z]
- if exist and exist.name and (not exist.part) then
- local block = exist
- exist.part = exist.name and getBlockModel(exist.name)
- local ws = Vector3.new(cx*16 + x,y,cy*16 + z)
- local binfo = M_BI[exist.name]
- local data = exist.data
- if block.part then
- block.part.CFrame = CFrame.new(ws*blocksize)
- if binfo and binfo.facingPos then
- if data and data.facing and binfo.facingPos[data.facing] then
- block.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[data.facing]
- elseif binfo.facingPosDef and binfo.facingPos[binfo.facingPosDef] then
- block.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[binfo.facingPosDef]
- end
- else
- local maxd = fMaxDepth[block.name]
- if block.depth and maxd then
- local ws = Vector3.new(cx*16 + x,y,cy*16 + z)
- block.part.CFrame = CFrame.new(ws*blocksize) * CFrame.new(0,-block.depth/(maxd+1) * blocksize,0)
- end
- end
- local inf = M_BI[block.part.Name]
- if totalClosure(block) < 6 then
- if inf and (inf.blocktype == "fluid") then
- block.part.Parent = chunk.vlfold
- else
- block.part.Parent = chunk.vfold
- end
- end
- block.part.CollisionGroupId = S_ReS.PhyGroups.World.Value
- -- for _,v in pairs(block.part:GetChildren()) do
- -- if v:IsA("Decal") then
- -- if (v.Face ~= Enum.NormalId.Right) then
- -- v.Color3 = Color3.new(0.6,0.6,0.6)
- -- end
- -- end
- -- end
- end
- end
- end
- spawn(function()
- --pcall(function()
- for xx,xt in pairs(chunk) do
- if type(xt) == "table" then
- for yy,yt in pairs(xt) do
- for zz,tab in pairs(yt) do
- if totalClosure(tab) < 6 then
- chunk.visualize(xx,yy,zz)
- end
- end
- end
- end
- end
- do local cc = getChunk(cx,cy-1)
- if cc then
- for xx,xt in pairs(cc) do
- if type(xt) == "table" then
- for yy,yt in pairs(xt) do
- local z = yt[15]
- if z and z.name then
- local c,ch = getBlock(xx + cx*16,yy,cy*16)
- if ch then
- local cv = 0
- if c and c.name then
- local info = blockinfo[c.name]
- cv = (info and info.closeValue) or 1
- end
- z.eyclosure = math.clamp(cv,0,1)
- if (cc.vfold.Parent) and (totalClosure(z) < 6) then
- if z.part then
- pcall(function()
- local inf = M_BI[z.part.Name]
- if inf and (inf.blocktype == "fluid") then
- z.part.Parent = cc.vlfold
- else
- z.part.Parent = cc.vfold
- end
- end)
- else
- cc.visualize(xx,yy,15)
- end
- end
- end
- end
- end
- end
- end
- end
- end
- do local cc = getChunk(cx,cy+1)
- if cc then
- for xx,xt in pairs(cc) do
- if type(xt) == "table" then
- for yy,yt in pairs(xt) do
- local z = yt[0]
- if z and z.name then
- local c,ch = getBlock(xx + cx*16,yy,15 + cy*16)
- if ch then
- local cv = 0
- if c and c.name then
- local info = blockinfo[c.name]
- cv = (info and info.closeValue) or 1
- end
- z.eyclosure = math.clamp(cv,0,1)
- if (cc.vfold.Parent) and (totalClosure(z) < 6) then
- if z.part then
- pcall(function()
- local inf = M_BI[z.part.Name]
- if inf and (inf.blocktype == "fluid") then
- z.part.Parent = cc.vlfold
- else
- z.part.Parent = cc.vfold
- end
- end)
- else
- cc.visualize(xx,yy,0)
- end
- end
- end
- end
- end
- end
- end
- end
- end
- do local cc = getChunk(cx+1,cy)
- if cc then
- for yy,yt in pairs(cc[0]) do
- for zz,z in pairs(yt) do
- if z and z.name then
- local c,ch = getBlock(15 + cx*16,yy,zz + cy*16)
- if ch then
- local cv = 0
- if c and c.name then
- local info = blockinfo[c.name]
- cv = (info and info.closeValue) or 1
- end
- z.exclosure = math.clamp(cv,0,1)
- if (cc.vfold.Parent) and (totalClosure(z) < 6) then
- if z.part then
- pcall(function()
- local inf = M_BI[z.part.Name]
- if inf and (inf.blocktype == "fluid") then
- z.part.Parent = cc.vlfold
- else
- z.part.Parent = cc.vfold
- end
- end)
- else
- cc.visualize(0,yy,zz)
- end
- end
- end
- end
- end
- end
- end
- end
- do local cc = getChunk(cx-1,cy)
- if cc then
- for yy,yt in pairs(cc[15]) do
- for zz,z in pairs(yt) do
- if z and z.name then
- local c,ch = getBlock(cx*16,yy,zz + cy*16)
- if ch then
- local cv = 0
- if c and c.name then
- local info = blockinfo[c.name]
- cv = (info and info.closeValue) or 1
- end
- z.exclosure = math.clamp(cv,0,1)
- if (cc.vfold.Parent) and (totalClosure(z) < 6) then
- if z.part then
- pcall(function()
- local inf = M_BI[z.part.Name]
- if inf and (inf.blocktype == "fluid") then
- z.part.Parent = cc.vlfold
- else
- z.part.Parent = cc.vfold
- end
- end)
- else
- cc.visualize(15,yy,zz)
- end
- end
- end
- end
- end
- end
- end
- end
- --end)
- wait()
- pcall(function() chunk.vfold.Parent = vblocks end)
- end)
- chunk.change = function(x,y,z,name,data)
- if (x < 0) or (x > 15)
- or (y < 0) or (y > 255)
- or (z < 0) or (z > 15)
- then return end
- --if chunk.vfold.Parent then print(x,y,z,name) end
- local success = false
- local block = {
- name = name,
- --part = name and script.Blocks[name]:Clone(),
- data = data,
- depth = data and data.depth,
- closure = 0,
- --exclosure = 0,
- --eyclosure = 0
- }
- if (x == 0) then
- local bl,ch = getBlock(x-1 + cx*16,y,z + cy*16)
- if (bl and bl.name) or (not ch) then
- block.exclosure = 1
- elseif not (bl and bl.name) then
- block.exclosure = 0
- end
- elseif (x == 15) then
- local bl,ch = getBlock(x+1 + cx*16,y,z + cy*16)
- if (bl and bl.name) or (not ch) then
- block.exclosure = 1
- elseif not (bl and bl.name) then
- block.exclosure = 0
- end
- end
- if (z == 0) then
- local bl,ch = getBlock(x + cx*16,y,z-1 + cy*16)
- if (bl and bl.name) or (not ch) then
- block.eyclosure = 1
- elseif not (bl and bl.name) then
- block.eyclosure = 0
- end
- elseif (z == 15) then
- local bl,ch = getBlock(x + cx*16,y,z+1 + cy*16)
- if (bl and bl.name) or (not ch) then
- block.eyclosure = 1
- elseif not (bl and bl.name) then
- block.eyclosure = 0
- end
- end
- local ws = Vector3.new(cx*16 + x,y,cy*16 + z)
- local binfo = M_BI[name]
- -- if block.part then
- --
- -- block.part.CFrame = CFrame.new(ws*blocksize)
- --
- -- if binfo and binfo.facingPos then
- -- if data and data.facing and binfo.facingPos[data.facing] then
- -- block.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[data.facing]
- -- elseif binfo.facingPosDef and binfo.facingPos[binfo.facingPosDef] then
- -- block.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[binfo.facingPosDef]
- -- end
- -- end
- --
- -- local inf = M_BI[block.part.Name]
- -- if inf and (inf.blocktype == "fluid") then
- -- block.part.Parent = chunk.vlfold
- -- else
- -- block.part.Parent = chunk.vfold
- -- end
- --
- -- block.part.CollisionGroupId = S_ReS.PhyGroups.World.Value
- --
- ---- for _,v in pairs(block.part:GetChildren()) do
- ---- if v:IsA("Decal") then
- ---- if (v.Face ~= Enum.NormalId.Right) then
- ---- v.Color3 = Color3.new(0.6,0.6,0.6)
- ---- end
- ---- end
- ---- end
- --
- -- end
- if binfo and binfo.facingPos then
- block.facing = (data and data.facing) or (binfo and binfo.facingPosDef) or 0
- end
- chunk[x] = chunk[x] or {}
- chunk[x][y] = chunk[x][y] or {}
- local exist = chunk[x][y][z]
- if exist and exist.name and exist.part then
- exist.part:Destroy()
- end
- local keepclosure = false
- if exist and exist.closure then
- block.closure = exist.closure
- if exist.name and name then
- keepclosure = true
- end
- --if (totalClosure(block) >= 6) and block.part then
- -- block.part.Parent = nil
- --end
- end
- success = ((not name) and exist and exist.name) or (name and ((not exist) or (exist and (exist.name ~= name))))
- --if not nopt then print(success) end
- chunk[x][y][z] = block
- --fastlink[x+cx*16][y][z+cy*16] = {block,chunk}
- local function gc(x2,y2,z2,c)
- --if (x2 < 0) or (x2 > 15)
- --or (y2 < 0) or (y2 > 255)
- --or (z2 < 0) or (z2 > 15)
- --then return end
- c = c or 1
- if (y2 < 0) or (y2 > 255) then return
- elseif (x2 < 0) or (x2 > 15) then
- local block,ch = getBlock(x2 + cx*16,y2,z2 + cy*16)
- if block then
- block.exclosure = math.clamp(c,0,1)
- if (not block.part) and ch.vfold.Parent then
- ch.visualize(x2%16,y2,z2)
- end
- if block.part then
- if (totalClosure(block) >= 6) then
- block.part.Parent = nil
- elseif (totalClosure(block) < 6) and not block.part.Parent then
- pcall(function() block.part.Parent = chunk.vfold end) -- destroyers
- end
- end
- end
- return
- elseif (z2 < 0) or (z2 > 15) then
- local block,ch = getBlock(x2 + cx*16,y2,z2 + cy*16)
- if block then
- block.eyclosure = math.clamp(c,0,1)
- if (not block.part) and ch.vfold.Parent then
- ch.visualize(x2,y2,z2%16)
- end
- if block.part then
- if (totalClosure(block) >= 6) then
- block.part.Parent = nil
- elseif (totalClosure(block) < 6) and not block.part.Parent then
- pcall(function() block.part.Parent = chunk.vfold end)
- end
- end
- end
- return
- end
- chunk[x2] = chunk[x2] or {}
- chunk[x2][y2] = chunk[x2][y2] or {}
- chunk[x2][y2][z2] = chunk[x2][y2][z2] or {}
- local block = chunk[x2][y2][z2]
- block.closure = math.clamp(block.closure and (block.closure + c) or c,0,6)
- --if not nopt then
- --print(x,y,z,";",x2,y2,z2,";",chunk[x2][y2][z2]["closure"])
- --end
- if (not block.part) and chunk.vfold.Parent then
- chunk.visualize(x2,y2,z2)
- end
- if block.part then
- if (totalClosure(block) >= 6) then
- block.part.Parent = nil
- elseif (totalClosure(block) < 6) and not block.part.Parent then
- pcall(function() block.part.Parent = chunk.vfold end)
- end
- end
- end
- local info = name and blockinfo[name]
- local blockval = (info and info.closeValue) or 1
- if success and (blockval > 0) and (not keepclosure) then
- --if success then
- gc(x,y,z+1,not name and -1)
- gc(x,y,z-1,not name and -1)
- gc(x,y+1,z,not name and -1)
- gc(x,y-1,z,not name and -1)
- gc(x+1,y,z,not name and -1)
- gc(x-1,y,z,not name and -1)
- --end
- end
- --if (totalClosure(block) < 6) and (not block.part) then
- if (not block.part) and chunk.vfold.Parent then
- --print("DOOM")
- chunk.visualize(x,y,z)
- --elseif chunk.vfold.Parent then
- --print(block.part:GetFullName())
- end
- if block and block.part and block.name then
- local maxd = fMaxDepth[block.name]
- if block.depth and maxd then
- local ws = Vector3.new(cx*16 + x,y,cy*16 + z)
- block.part.CFrame = CFrame.new(ws*blocksize) * CFrame.new(0,-block.depth/(maxd+1) * blocksize,0)
- end
- end
- if tarUsedBlock then
- if ((x+cx*16) == tarUsedBlock.X) and (y == tarUsedBlock.Y) and ((z+cy*16) == tarUsedBlock.Z) then
- updateExternals()
- end
- end
- --end
- return block,success
- end
- chunk.update = function(x,y,z,dat)
- chunk[x] = chunk[x] or {}
- chunk[x][y] = chunk[x][y] or {}
- local exist = chunk[x][y][z]
- if exist and exist.name and exist.part then
- for i,v in pairs(dat) do
- exist[i] = v
- end
- if exist.dstage and (exist.dstage >= 0) and (exist.dstage < 10) then
- local left = {}
- for _,v in pairs(exist.part:GetChildren()) do
- if v.Name == "BreakSG" then
- left[v.Face] = true
- for i=0,exist.dstage do
- v["Stage" .. i].Visible = true
- end
- end
- end
- for _,v in pairs(Enum.NormalId:GetEnumItems()) do
- if not left[v] then
- local bsg = script.BreakSG:Clone()
- bsg.Face = v
- for i=0,exist.dstage do
- bsg["Stage" .. i].Visible = true
- end
- bsg.Parent = exist.part
- end
- end
- else
- for _,v in pairs(exist.part:GetChildren()) do
- if v.Name == "BreakSG" then
- v:Destroy()
- end
- end
- end
- if exist.part then
- local binfo = M_BI[exist.name]
- local ws = Vector3.new(cx*16 + x,y,cy*16 + z)
- exist.part.CFrame = CFrame.new(ws*blocksize)
- if binfo and binfo.facingPos then
- if exist.facing and binfo.facingPos[exist.facing] then
- exist.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[exist.facing]
- elseif binfo.facingPosDef and binfo.facingPos[binfo.facingPosDef] then
- exist.part.CFrame = CFrame.new(ws*blocksize) * binfo.facingPos[binfo.facingPosDef]
- end
- end
- end
- end
- end
- world[cx] = world[cx] or {}
- world[cx][cy] = chunk
- return chunk
- end
- function loadChunk(x,y,data)
- local chunk = getChunk(x,y) or createChunk(x,y)
- for xx,xt in pairs(data) do
- --print("X " .. xx .. " ------")
- for yy,yt in pairs(xt) do
- --print("\tY " .. yy .. " ------")
- for zz,bl in pairs(yt) do
- if bl.name then
- --print("\t\tZ " .. zz .. " ------ " .. bl.name)
- chunk.change(tonumber(xx),tonumber(yy),tonumber(zz),bl.name,bl)
- end
- end
- end
- end
- end
- function loadServerChunk(x,y)
- local chunk = getChunk(x,y)
- if (not chunk) and (not (loadingChunks[x] and loadingChunks[x][y])) then
- loadingChunks[x] = loadingChunks[x] or {}
- loadingChunks[x][y] = true
- coroutine.resume(coroutine.create(function()
- local dat = game.ReplicatedStorage.VisualRemotes.GetChunk:InvokeServer(x,y)
- loadChunk(x,y,dat)
- loadingChunks[x][y] = false
- end))
- end
- end
- S_ReS.GameRemotes.OnPlaceBlock.OnClientEvent:Connect(function(by,x,y,z,name,dat,silent)
- if plr ~= by then
- placeBlockFS(x,y,z,name,dat,silent)
- end
- end)
- S_ReS.GameRemotes.OnBreakBlock.OnClientEvent:Connect(function(by,x,y,z)
- if (getGamemode() ~= 1) or (plr ~= by) then
- destroyBlock(x,y,z)
- end
- end)
- S_ReS.VisualRemotes.UpdateBlock.OnClientEvent:Connect(function(x,y,z,dat)
- --print("Got",x,y,z,dat)
- updateBlock(x,y,z,dat)
- end)
- S_ReS.VisualRemotes.BlockChanged.OnClientEvent:Connect(function(x,y,z,name,dat)
- --print("Got",x,y,z)
- local bl,ch = getBlock(x,y,z)
- --print(bl and bl.name)
- if ch then
- ch.change(x%16,y,z%16,name)
- end
- end)
- ----- Camera based functions
- --local FOVTar = 70 + char.Humanoid.WalkSpeed
- local walk = 0
- local walkC = 0
- local walkS = false
- local hrollTar = 0
- local hrollCur = 0
- local pitchCur = 0
- local last_cam_rx = 0
- local lastCF = workspace.CurrentCamera.CFrame
- function beforeCam()
- workspace.CurrentCamera.CFrame = lastCF
- end
- local hand = nil
- local hand_type = 0
- local hand_prev = nil
- local hand_lastN = nil
- local cam_mx = 0
- local cam_my = 0
- local cam_mx2 = 0
- local cam_my2 = 0
- function mainCam(dt)
- ----- Camera Setting -----
- -- set the lastCF
- local delta = workspace.CurrentCamera.CFrame * lastCF:Inverse()
- delta = CFrame.new(Vector3.new(),delta.LookVector)
- local temp_x = lastCF:ToEulerAnglesYXZ()
- local d_x = temp_x - last_cam_rx
- last_cam_rx = temp_x
- local _,d_y = delta:ToEulerAnglesYXZ()
- lastCF = workspace.CurrentCamera.CFrame
- local wx = math.sin(-walk)/6 * walkC
- local wy = (math.abs(math.cos(walk))/4) * walkC
- local wrx = (-math.abs(math.cos(walk))/90) * walkC
- local wrz = math.sin(-walk)/200 * walkC
- cam_mx = cam_mx - d_x
- cam_my = cam_my - d_y
- cam_mx = math.clamp(lerp(cam_mx,0,0.3),-.1,.1)
- cam_my = math.clamp(lerp(cam_my,0,0.3),-.1,.1)
- cam_mx2 = lerp(cam_mx2,cam_mx,0.7)
- cam_my2 = lerp(cam_my2,cam_my,0.7)
- --print(wy)
- --local char = plr.Character
- local human = char and char:FindFirstChild("Humanoid")
- local htorso = char and char:FindFirstChild("HumanoidRootPart")
- local function doFootstep()
- if grounded then
- local pos = htorso.Position + Vector3.new(0,-3 - blocksize/2,0)
- local bl,ch = getBlock(PtoT(pos.X,pos.Y,pos.Z))
- if bl and bl.name then
- local bi = M_BI[bl.name]
- if bi then
- --print("Footstep")
- local mat = materialsounds[bi.material or "default"] or materialsounds["default"]
- playSound(htorso.Position + Vector3.new(0,-3,0),mat)
- end
- end
- end
- end
- if human and htorso then
- local head,torso = char:FindFirstChild("Head"),char:FindFirstChild("Torso")
- if head and torso then
- local neck = torso:FindFirstChild("Neck")
- if neck then
- local xx,yy,zz = workspace.CurrentCamera.CFrame:ToEulerAnglesYXZ()
- game.ReplicatedStorage.VisualRemotes.ChangeNeckWeld:FireServer(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0) * CFrame.Angles(-xx,0,0))
- end
- end
- local lv = workspace.CurrentCamera.CFrame.LookVector
- local rlv = Vector3.new(lv.X,0,lv.Z)
- --print(htorso.Velocity.Y / (math.abs(htorso.Velocity.Y+1)^2))
- local vel = htorso.Velocity
- if (human.MoveDirection.Magnitude > 0) and grounded then
- walk = (walk + Vector3.new(vel.X,0,vel.Z).Magnitude/blocksize*1.8 * dt)%(math.pi*2)
- walkC = lerp(walkC,1,0.1)
- if ((walk >= math.pi*1.5) or (walk < math.pi*.5)) and (not walkS) then
- walkS = true
- doFootstep()
- elseif ((walk < math.pi*1.5) and (walk >= math.pi*.5)) and (walkS) then
- walkS = false
- doFootstep()
- end
- else
- --walk = 0
- walkC = lerp(walkC,0,0.2)
- end
- pitchCur = lerp(pitchCur,math.tanh(htorso.Velocity.Y/100)/10,0.4)
- end
- hrollTar = (1 - math.clamp(hurttimer*12 - .1,0,1)) * 1
- hrollCur = lerp(hrollCur,hrollTar,0.15)
- if human then human.CameraOffset = Vector3.new(0 + wx,0.3 + wy,0) end
- local camcf = workspace.CurrentCamera.CFrame * CFrame.new(0,0,-.45) * CFrame.Angles(temp_x*0.125,0,0)
- workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0,0,-.45) * CFrame.Angles(temp_x*0.125 + pitchCur + wrx,0,hrollCur + wrz)
- ----- Hand -----
- if not (hand and hand.Parent) then
- hand = script.Hand:Clone()
- hand.Parent = workspace.CurrentCamera
- end
- local name = nil
- if hand and selSlotV then
- local tab = S_H:JSONDecode(selSlotV.Value)
- if tab.name and (tab.count > 0) then
- name = tab.name
- end
- end
- --print(name,hand_lastN)
- if name ~= hand_lastN then
- hand_lastN = name
- if name then
- local item = M_II[name]
- local part = nil
- if item then
- if item.block then
- local block = getBlockModel(item.block)
- if block then
- block = block:Clone()
- block.Size = Vector3.new(.35,.35,.35)*2
- block.CanCollide = false
- block.Anchored = true
- hand_type = 1
- part = block
- end
- end
- if not part then
- local tex = (script.ItemTextures:FindFirstChild(item.texture or "missing") or script.ItemTextures.missing):Clone()
- local sgp = Instance.new("Part")
- sgp.Size = Vector3.new(1.5,1.5,0.05)
- sgp.Transparency = 1
- sgp.CanCollide = false
- sgp.Anchored = true
- local sgui = Instance.new("SurfaceGui")
- sgui.CanvasSize = Vector2.new(32,32)
- sgui.Face = Enum.NormalId.Front
- sgui.LightInfluence = 1
- tex:Clone().Parent = sgui
- local sgui2 = Instance.new("SurfaceGui")
- sgui2.CanvasSize = Vector2.new(32,32)
- sgui2.Face = Enum.NormalId.Back
- sgui.LightInfluence = 1
- tex.Parent = sgui2
- sgui.Parent = sgp
- sgui2.Parent = sgp
- hand_type = 2
- part = sgp
- end
- end
- hand:Destroy()
- if part then
- part.Parent = workspace.CurrentCamera
- hand = part
- end
- else
- hand:Destroy()
- hand_type = 0
- hand = script.Hand:Clone()
- hand.Parent = workspace.CurrentCamera
- end
- end
- if human then
- local at = .25
- bob_attack = math.clamp(bob_attack,0,at)
- local a = bob_attack/at
- local c = math.sin(-a*4)
- local d = math.sin((a^(1/3))*1.6)
- local val1 = workspace.Val1.Value
- local val2 = workspace.Val2.Value
- local camcf = camcf * CFrame.fromEulerAnglesYXZ(cam_mx2,cam_my2,0)
- if hand_type == 0 then
- local b = math.sin(a*2.2)
- 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)))
- elseif hand_type == 1 then
- local b = math.sin(a*2.618)*2
- --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)))
- 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)))
- elseif hand_type == 2 then
- local b = math.sin(a*2.718)*2
- local b2 = math.sin(a*2.8)*1.24
- local c = math.sin(-a*4.7)
- c = (c<0) and c*1.5 or c
- 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)))
- end
- bob_attack = math.clamp(bob_attack - dt,0,at)
- end
- ----- Lighting -----
- local fogc = Vector3.new(217, 236, 255)/255
- local foge = 200
- local tp = workspace.CurrentCamera.CFrame.Position
- local bl,ch = getBlock(PtoT(tp.X,tp.Y,tp.Z))
- local exist = bl and bl.name
- local inf = exist and M_BI[exist]
- L_CC.Brightness = 0
- L_CC.Contrast = -.1
- L_CC.Saturation = -.2
- L_CC.TintColor = Color3.new(1,1,1)
- local isBreathable = (not exist) or (inf.blocktype == "fluid") or (inf.blocktype == "nonsolid")
- if not isBreathable then
- if sufftimer <= 0 then
- reqDamage(5,"suffocation")
- --game.ReplicatedStorage.GameRemotes.RequestDamage:FireServer(5,"suffocation")
- sufftimer = sufftimer + 0.5
- end
- sufftimer = sufftimer - dt
- L_CC.Brightness = -.2
- L_CC.Contrast = -.1
- L_CC.Saturation = -.2
- L_CC.TintColor = Color3.new(1,1,1)
- elseif exist == "Water" then
- fogc = Vector3.new(43, 123, 119)/255
- foge = 50
- L_CC.Brightness = -.1
- L_CC.Contrast = -.1
- L_CC.Saturation = -.2
- L_CC.TintColor = Color3.new(198/255,251/255,1)
- elseif exist == "Lava" then
- fogc = Vector3.new(245, 101, 10)/255
- foge = 12
- L_CC.Brightness = .2
- L_CC.Contrast = -.4
- L_CC.Saturation = -.5
- L_CC.TintColor = Color3.new(1,132/255,30/255)
- end
- local ct = game.Lighting.ClockTime
- local cd = (ct < 12) and (math.clamp(ct-6,0,1)) or (1-math.clamp(ct-17,0,1))
- local fog = fogc*cd
- game.Lighting.FogColor = Color3.new(fog.X,fog.Y,fog.Z)
- game.Lighting.FogEnd = foge
- game.Lighting.FogStart = foge/4
- --print(math.deg(workspace.CurrentCamera.CFrame:ToEulerAnglesYXZ()))
- -- update info
- local lposs = workspace.CurrentCamera.CFrame.Position
- 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))
- hurttimer = math.clamp(hurttimer + dt,0,10)
- voidtimer = math.max(voidtimer - dt,0)
- if p_gui:FindFirstChild("HUDGui") then
- p_gui.HUDGui.DataFrame.Coord.Text = "Coordinates: " .. lpos.X .. " " .. lpos.Y .. " " .. lpos.Z
- p_gui.HUDGui.DataFrame.ServerAge.Text = "Svr. age (real time): " .. getTimeFromSeconds(workspace.ServerInfo.ServerAge.Value)
- p_gui.HUDGui.DataFrame.GameAge.Text = "Game age: " .. getTimeFromSeconds(workspace.ServerInfo.GameAge.Value)
- end
- end
- S_RS:BindToRenderStep("NS_cam_bf",Enum.RenderPriority.Input.Value - 1,beforeCam)
- S_RS:BindToRenderStep("NS_cam",Enum.RenderPriority.Camera.Value + 1,mainCam)
- S_RS:BindToRenderStep("vloop",Enum.RenderPriority.Camera.Value + 1,function(dt)
- rmouse.Icon = invOpen and "" or "rbxasset://textures/Blank.png"
- if char and char:FindFirstChild("Humanoid") then
- workspace.CurrentCamera.FieldOfView = lerp(workspace.CurrentCamera.FieldOfView,54 + char.Humanoid.WalkSpeed*2,0.25)
- else
- workspace.CurrentCamera.FieldOfView = 80
- end
- --print("Timer:",breakTimer)
- --
- local ch = char
- if ch then
- local human = ch:FindFirstChild("Humanoid")
- if human then
- human.HipHeight = 0.1--0.4
- --human.CameraOffset = Vector3.new(0,-human.HipHeight + .4,0)
- end
- local cf,block,nor = mouse:ProjectMouseRay2({vblocks})
- local cf2,partp,nor2 = mouse:ProjectMouseRay({workspace.CurrentCamera,vliquid,char})
- if partp and partp.Parent and ((cf2.Position - workspace.CurrentCamera.CFrame.Position).Magnitude < 8) and game.Players:GetPlayerFromCharacter(partp.Parent) then
- tarPlayer = partp.Parent
- else
- tarPlayer = nil
- end
- if (cf.Position - workspace.CurrentCamera.CFrame.Position).Magnitude < (5*blocksize) then
- tarBlock = block
- if block then
- tarDir = nor
- if abreak and (getGamemode() ~= 1) then
- local pos = Vector3.new(PtoT(block.Position.X,block.Position.Y,block.Position.Z))
- if (breaking ~= pos) then
- --print("Ok new one")
- breakBlock(pos.X,pos.Y,pos.Z,true)
- elseif breaking then
- --print("Timer Before:",breakTimer)
- breakTimer = breakTimer - dt
- breakDTimer = breakDTimer - dt
- breakSTimer = breakSTimer - dt
- if breakSTimer <= 0 then
- bob_attack = 10
- breakSTimer = .2
- local bi = M_BI[block.Name]
- if bi then
- --print("Footstep")
- local mat = materialsounds[bi.material or "default"] or materialsounds["default"]
- local s = playSound((Vector3.new(pos.X,pos.Y,pos.Z)+ nor/2)*blocksize,mat,.6 + math.random()*.05,.55)
- if s then
- local ee = Instance.new("EqualizerSoundEffect")
- ee.HighGain = -1
- ee.MidGain = -1
- ee.LowGain = -4
- ee.Parent = s
- end
- end
- end
- if breakDTimer <= 0 then
- breakDTimer = .25
- for i=1,math.random(2,5) do -- create debris particles
- local p = FX_P:Clone()
- 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)))
- p.Velocity = Vector3.new((math.random()-.5)*9,math.random()*6 + 6,(math.random()-.5)*9)
- p.BGui.ImageLabel.Image = "http://www.roblox.com/Thumbs/Asset.ashx?width=420&height=420&assetId=" .. (tex[deb[block.Name]] or "75880927")
- p.BGui.ImageLabel.ImageRectOffset = Vector2.new(math.random(0,360),math.random(0,360))
- local r= math.random()
- p.BGui.Size = UDim2.new(0.3 + r*.1,0,0.3 + r*.1,0)
- p.Parent = workspace.CurrentCamera
- p.CollisionGroupId = S_ReS.PhyGroups.Particles.Value
- game.Debris:AddItem(p,math.random()*2)
- end
- end
- if breakTimer <= 0 then
- --destroyBlock(breaking.X,breaking.Y,breaking.Z)
- --breakTimer = .5
- --print("Timer Now:",breakTimer)
- --breaking = nil
- coroutine.resume(coroutine.create(function() S_ReS.GameRemotes.AcceptBreakBlock:InvokeServer() end))
- end
- end
- end
- end
- if block then
- sbox.Adornee = block
- else
- sbox.Adornee = nil
- end
- else
- if breaking then
- cancelBlock()
- end
- tarBlock = nil
- sbox.Adornee = nil
- end
- end
- lastBreaking = breaking
- end)
- local frozen = false
- S_RS:BindToRenderStep("rloop",Enum.RenderPriority.Camera.Value + 1,function(dt) -- quick updates to humanoid, etc.
- if char and char:FindFirstChild("HumanoidRootPart") then
- local htorso = char.HumanoidRootPart
- local pos = htorso.Position
- local cx,cy = math.floor(pos.X/16/blocksize),math.floor(pos.Z/16/blocksize)
- if not getChunk(cx,cy) then
- if not frozen then
- htorso.Anchored = true
- frozen = true
- end
- elseif frozen then
- frozen = false
- htorso.Anchored = false
- end
- end
- end)
- ----- Inputs
- function sprint(aName,state)
- if char and char:FindFirstChild("Humanoid") then
- if S_UIS.TouchEnabled then
- if state == Enum.UserInputState.Begin then
- if sprinting then
- sprinting = false
- char.Humanoid.WalkSpeed = 13
- else
- sprinting = true
- char.Humanoid.WalkSpeed = 16.83
- end
- end
- else
- if state == Enum.UserInputState.Begin then
- sprinting = true
- char.Humanoid.WalkSpeed = 16.83
- elseif state == Enum.UserInputState.End then
- sprinting = false
- char.Humanoid.WalkSpeed = 13
- end
- end
- end
- end
- function dropItem(aName,state)
- if state == Enum.UserInputState.Begin then
- game.ReplicatedStorage.GameRemotes.DropItem:InvokeServer()
- end
- end
- function attemptUse()
- if tarBlock then
- bob_attack = 10
- local bl,ch = getBlock(PtoT(tarBlock.Position))
- if bl and bl.name then
- if bl.name == "CraftingTable" then
- tarUsedBlock = Vector3.new(PtoT(tarBlock.Position))
- openInv("CraftingTable")
- return true
- elseif bl.name == "Chest" then
- tarUsedBlock = Vector3.new(PtoT(tarBlock.Position))
- openInv("Chest")
- return true
- elseif bl.name == "Furnace" then
- tarUsedBlock = Vector3.new(PtoT(tarBlock.Position))
- openInv("Furnace")
- return true
- end
- end
- end
- end
- function attemptPlace()
- bob_attack = 10
- if tarBlock then
- local tab = S_H:JSONDecode(selSlotV.Value)
- local iname = tab.name
- local item = iname and M_II[iname]
- local block = item and item.block
- if block or (item and item.placeable) then
- local binfo = M_BI[iname]
- local x,y,z = PtoT(tarBlock.Position + (tarDir*blocksize))
- placeBlock(x,y,z,selSlot,tarDir,binfo and binfo.blocktype and (binfo.blocktype == "nonsolid"))
- end
- end
- end
- function attemptAttack()
- bob_attack = 10
- if tarPlayer then
- game.ReplicatedStorage.GameRemotes.Attack:InvokeServer(tarPlayer)
- return true
- end
- end
- function attemptBreak(state)
- abreak = state
- if state then
- bob_attack = 10
- if tarBlock then
- breakBlock(PtoT(tarBlock.Position))
- return true
- end
- elseif breaking then
- cancelBlock()
- return true
- end
- end
- function primary()
- if not attemptAttack() then attemptBreak(true) end
- end
- function primaryRelease()
- attemptBreak(false)
- end
- function secondary()
- if not attemptUse() then attemptPlace() end
- end
- function onInput(input,state)
- if state then
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- primary()
- elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
- secondary()
- elseif input.UserInputType == Enum.UserInputType.Keyboard then
- --if input.KeyCode == Enum.KeyCode.LeftControl then
- -- sprint(state)
- --elseif input.KeyCode == Enum.KeyCode.E then
- --toggleInv()
- --else
- local tS = {
- "One","Two","Three","Four","Five","Six","Seven","Eight","Nine"
- }
- local tSR = {}
- for i,v in pairs(tS) do
- tSR[v] = i
- end
- local num = tSR[input.KeyCode.Name]
- if num then
- if (num >= 1) and (num < 10) then
- setSelSlot(num - 1)
- end
- end
- --end
- end
- elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
- primaryRelease()
- --elseif input.UserInputType == Enum.UserInputType.Keyboard then
- --if input.KeyCode == Enum.KeyCode.LeftControl then
- -- sprint(state)
- --end
- end
- end
- S_CAS:BindAction("dropItem",dropItem,false,Enum.KeyCode.Q)
- S_CAS:BindAction("toggleInv",toggleInv,true,Enum.KeyCode.E)
- S_CAS:SetImage("toggleInv","rbxassetid://3164650906")
- S_CAS:SetDescription("toggleInv","Toggle inventory")
- S_CAS:SetPosition("toggleInv",UDim2.new(0.3,0,0,0))
- S_CAS:BindAction("sprint",sprint,true,Enum.KeyCode.LeftControl)
- S_CAS:SetTitle("sprint","Sprint")
- S_CAS:SetPosition("sprint",UDim2.new(0.6,0,0,0))
- S_UIS.TouchTap:Connect(function(tpos,gp)
- if not gp then
- if not attemptAttack() then attemptPlace() end
- end
- end)
- S_UIS.TouchLongPress:Connect(function(tpos,state,gp)
- if not gp then
- if state == Enum.UserInputState.Begin then
- attemptBreak(true)
- elseif state == Enum.UserInputState.End then
- attemptBreak(false)
- end
- end
- end)
- S_UIS.InputBegan:Connect(function(input,gp)
- if not gp then
- onInput(input,true)
- end
- end)
- S_UIS.InputEnded:Connect(function(input,gp)
- --if not gp then
- onInput(input,false)
- --end
- end)
- S_UIS.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement then
- elseif input.UserInputType == Enum.UserInputType.MouseWheel then
- changeSelSlot(-input.Position.Z)
- end
- end)
- ----- Load up / Additional things
- local isFalling2 = false
- local isFalling = false
- local fallDist = 0
- local lastY = 0
- local isLoading = false
- function reload()
- print("- Reloading character... -")
- local function sep(f)
- spawn(function() pcall(f) end)
- end
- -- Reset Vari
- isFalling2 = false
- isFalling = false
- fallDist = 0
- lastY = 0
- E_cVel = Vector3.new()
- if hand then hand:Destroy() end
- local sss = 0
- local eee = 0
- for _,v in pairs(chCons) do
- local ok,msg = pcall(v.Disconnect,v)
- if ok then
- sss = sss + 1
- else
- eee = eee + 1
- end
- end
- chCons = {}
- print("Successfully disconnected",sss,"signal connections")
- -- lgui
- local lgui = p_gui:WaitForChild("LoadingGui",2)
- -- set char anchor
- local htorso = char:WaitForChild("HumanoidRootPart")
- char.HumanoidRootPart.CFrame = CFrame.new(0,60*blocksize,0)
- htorso.Anchored = true
- -- Wait for inventory
- sep(function()
- lgui.Label1.Text = "Loading inventory.."
- lgui.Label1Shadow.Text = "Loading inventory.."
- end)
- s_inv = char:WaitForChild("Inventory")
- while #s_inv:GetChildren() < 45 do
- local c = math.clamp(#s_inv:GetChildren()/36,0,1)
- lgui.LBar.Bar.Size = UDim2.new(c,0,1,0)
- wait()
- end
- print("Inventory has been updated")
- -- Vari
- local human = char:WaitForChild("Humanoid")
- -- Link health
- sep(function()
- lgui.Label1.Text = "Loading HUD.."
- lgui.Label1Shadow.Text = "Loading HUD.."
- end)
- linkHealth(human)
- -- Load inventory
- loadInventory()
- setSelSlot(0)
- print("Loaded inventory hud")
- -- Load chunks first
- -- lgui.Label1.Text = "Loading chunks first.."
- -- lgui.Label1Shadow.Text = "Loading chunks first.."
- -- lgui.LBar.Bar.Size = UDim2.new(0,3,1,0)
- -- loadServerChunk(0,0)
- -- lgui.LBar.Bar.Size = UDim2.new(.25,0,1,0)
- -- loadServerChunk(-1,0)
- -- lgui.LBar.Bar.Size = UDim2.new(.5,0,1,0)
- -- loadServerChunk(0,-1)
- -- lgui.LBar.Bar.Size = UDim2.new(.75,0,1,0)
- -- loadServerChunk(-1,-1)
- -- --generateChunk()
- -- --generateChunk(-1,0)
- -- --generateChunk(0,-1)
- -- --generateChunk(-1,-1)
- -- print("Loaded chunks first")
- -- Misc
- human:SetStateEnabled(Enum.HumanoidStateType.Climbing,false)
- human.MaxSlopeAngle = 1
- human.StateChanged:Connect(function(old,new)
- --print(old,">>>",new)
- if (new == Enum.HumanoidStateType.Running)
- or (new == Enum.HumanoidStateType.RunningNoPhysics)
- or (new == Enum.HumanoidStateType.Landed)
- or (new == Enum.HumanoidStateType.StrafingNoPhysics) then
- grounded = true
- if new == Enum.HumanoidStateType.Landed then
- local pos = htorso.Position + Vector3.new(0,-3 - blocksize/2,0)
- local bl,ch = getBlock(PtoT(pos.X,pos.Y,pos.Z))
- if bl and bl.name then
- local bi = M_BI[bl.name]
- if bi then
- --print("Footstep")
- local mat = materialsounds[bi.material or "default"] or materialsounds["default"]
- playSound(htorso.Position + Vector3.new(0,-3,0),mat,1.3,.8)
- end
- end
- end
- else
- grounded = false
- end
- if new == Enum.HumanoidStateType.Freefall then
- isFalling = true
- fallDist = 0
- lastY = char.HumanoidRootPart.Position.Y
- elseif old == Enum.HumanoidStateType.Freefall then
- isFalling = false
- end
- end)
- spawn(function()
- char:WaitForChild("Sound"):WaitForChild("LocalSound").Disabled = true
- print("Disabled local default sounds")
- end)
- -- Tp to land
- sep(function()
- lgui.LBar.Visible = false
- lgui.Label1.Text = "Waiting for chunks.."
- lgui.Label1Shadow.Text = "Waiting for chunks.."
- end)
- local spposv = game.ReplicatedStorage.PlayerPositionSaves:FindFirstChild(tostring(plr.UserId))
- local sppos = spposv and spposv.Value
- local wpos = S_ReS.WorldSpawn.Value
- if sppos then
- htorso.Anchored = false
- htorso.CFrame = CFrame.new(sppos.X,sppos.Y,sppos.Z)
- else
- htorso.CFrame = CFrame.new(wpos.X,60*blocksize,wpos.Z)
- local vp,vp2 = workspace:FindPartOnRayWithWhitelist(Ray.new(htorso.Position,Vector3.new(0,-255*blocksize)),{vblocks})
- 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
- htorso.Anchored = false
- htorso.CFrame = CFrame.new(vp2 + Vector3.new(0,blocksize*2,0))
- end
- game.ReplicatedStorage.GameRemotes.StartRecordingPos:FireServer()
- isFalling = false
- isFalling2 = false
- fallDist = 0
- -- Remove loading gui
- sep(function()
- if lgui then workspace.CurrentCamera.FieldOfView = 54 lgui:Destroy() end
- end)
- print("Character is successfully loaded")
- end
- plr.CharacterAdded:Connect(function(ch)
- char=ch
- reload()
- end)
- spawn(reload)
- game.ReplicatedStorage.GameRemotes.ServerChat.OnClientEvent:Connect(function(msg)
- -- game.StarterGui:SetCore("ChatMakeSystemMessage", {
- -- Text = msg["Text"]; -- Required. Has to be a string!
- -- 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)
- -- Font = msg[3] or Enum.Font.SourceSansBold; -- Optional, defaults to Enum.Font.SourceSansBold
- -- FontSize = Enum.FontSize.Size32; -- Optional, defaults to Enum.FontSize.Size18
- -- })
- game.StarterGui:SetCore("ChatMakeSystemMessage", msg)
- --for i=1,5 do
- -- wait(0.05)
- --script.Beep:Play()
- --end
- end)
- ----- The Loop
- function mLoop(dt)
- if char and char.Parent and char:FindFirstChild("HumanoidRootPart") then
- local human = char.Humanoid
- local htorso = char.HumanoidRootPart
- for _,v in pairs(char:GetChildren()) do
- if v:IsA("BasePart") then
- v.Massless = v.Name ~= "HumanoidRootPart"
- end
- end
- -- htorso.Anchored = true
- local pos = htorso.Position
- local bl,ch = getBlock(PtoT(pos.X,pos.Y-2,pos.Z))
- local exist = bl and bl.name
- local bf = htorso:FindFirstChild("Grav")
- if not bf then
- bf = Instance.new("BodyForce")
- bf.Name = "Grav"
- bf.Force = Vector3.new()
- bf.Parent = htorso
- end
- local bv = htorso:FindFirstChild("Swim")
- if not bv then
- bv = Instance.new("BodyVelocity")
- bv.Name = "Swim"
- bv.Velocity = Vector3.new()
- bv.MaxForce = Vector3.new()
- bv.Parent = htorso
- end
- --
- -- local gravity = Vector3.new(0,-workspace.Gravity*dt*dt,0)
- -- local function rep()
- -- local apos = htorso.Position + E_cVel*dt
- -- local a,b,c = PtoT(apos.X,apos.Y - (E_size.Y/2*blocksize),apos.Z)
- -- local bl,ch = getBlock(a,b,c)
- -- local exist = bl and bl.name
- --
- -- if exist then
- -- --print(exist,"ground")
- -- ground = true
- -- --print((b*blocksize))
- -- --print((b*blocksize)+(blocksize/2) + (E_size.Y/2*blocksize),apos.Y)
- -- local b = (b*blocksize)+(blocksize/2) + (E_size.Y/2*blocksize)
- -- --print(b,E_cVel.Y,apos.Y)
- -- local aa = (apos.Y-b)
- -- E_cVel = Vector3.new(E_cVel.X,E_cVel.Y - aa,E_cVel.Z)
- -- else
- -- ground = false
- -- end
- -- htorso.CFrame = htorso.CFrame + (E_cVel)
- -- htorso.Velocity = E_cVel
- -- end
- --
- -- print(E_cVel)
- --
- local vel = htorso.Velocity
- if exist == "Lava" then
- inWater = false
- bf.Force = Vector3.new(0,workspace.Gravity*0.75,0)
- if human.Jump then
- bv.Velocity = Vector3.new(0,3,0)
- bv.MaxForce = Vector3.new(0,280,0)
- bv.P = 7500
- else
- bv.MaxForce = Vector3.new(0,0,0)
- end
- htorso.Velocity = vel*0.5
- elseif exist == "Water" then
- inWater = true
- bf.Force = Vector3.new(0,workspace.Gravity*0.75,0)
- if human.Jump then
- bv.Velocity = Vector3.new(0,3,0)
- bv.MaxForce = Vector3.new(0,280,0)
- bv.P = 7500
- else
- bv.MaxForce = Vector3.new(0,0,0)
- end
- htorso.Velocity = vel*0.8
- else
- inWater = false
- bv.Velocity = Vector3.new()
- bv.MaxForce = Vector3.new()
- bf.Force = Vector3.new()
- --htorso.Velocity = Vector3.new(vel.X*0.6,vel.Y*0.98,vel.Z*0.6)
- end
- if (voidtimer <= 0) and (htorso.Position.Y <= (-64*blocksize)) then
- reqDamage(20,"void")
- --S_ReS.GameRemotes.RequestDamage:FireServer(20,"void")
- voidtimer = 0.5
- end
- if isFalling and (not inWater) then
- isFalling2 = true
- local change = char.HumanoidRootPart.Position.Y - lastY
- lastY = char.HumanoidRootPart.Position.Y
- if change < 0 then
- fallDist = fallDist - change
- end
- elseif isFalling2 then
- isFalling2 = false
- local change = char.HumanoidRootPart.Position.Y - lastY
- lastY = char.HumanoidRootPart.Position.Y
- if change < 0 then
- fallDist = fallDist - change
- end
- -- print("Math time!")
- -- print(fallDist)
- -- print(fallDist/blocksize)
- -- print(fallDist/blocksize - 3)
- -- print(math.max(0,(fallDist/blocksize)-3))
- -- print(math.max(0,(fallDist/blocksize)-3)*5)
- if not inWater then
- local fdmg = math.max(0,((fallDist/blocksize)+.1)-3)*5
- if fdmg >= 5 then
- reqDamage(fdmg,"fall")
- --S_ReS.GameRemotes.RequestDamage:FireServer(fdmg,"fall")
- --char.Humanoid:TakeDamage(fdmg)
- end
- end
- fallDist = 0
- end
- end
- end
- S_RS:BindToRenderStep("mloop",Enum.RenderPriority.Camera.Value + 1,mLoop)
- game.ReplicatedStorage.GameRemotes.BeingAttacked.OnClientEvent:Connect(function(dir)
- for _,v in pairs(char:GetChildren()) do
- if v:IsA("BasePart") then
- 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
- end
- end
- end)
- game:GetService("ScriptContext").Error:Connect(function(message)
- if message == "not enough memory" then
- plr:Kick("Not enough memory, please reconnect")
- end
- end)
- --spawn(function()
- while wait() do
- local dist = 3
- local nearestCC = nil
- local ccpos = workspace.CurrentCamera.CFrame.Position
- local cpos = Vector2.new(math.floor(ccpos.X/16/blocksize),math.floor(ccpos.Z/16/blocksize))
- for x=-3,3 do
- for y=-3,3 do
- local pos2 = Vector2.new(x+cpos.X,y+cpos.Y)
- local dist2 = (pos2 - cpos).Magnitude
- if (dist2 < dist) then-- and (math.random()^0.5 < (dist2/2.5))
- local chunk = getChunk(pos2.X,pos2.Y)
- if (not chunk) and (not (loadingChunks[x] and loadingChunks[x][y])) then
- --spawn(function() loadServerChunk(pos2.X,pos2.Y) end)
- nearestCC = pos2
- dist = dist2
- end
- end
- end
- end
- if nearestCC then
- --spawn(function() generateChunk(nearestCC.X,nearestCC.Y) end)
- spawn(function() loadServerChunk(nearestCC.X,nearestCC.Y) end)
- end
- local dist = viewdist
- local farCC = nil
- local farpos = nil
- local ccpos = workspace.CurrentCamera.CFrame.Position
- local cpos = Vector2.new(math.floor(ccpos.X/16/blocksize),math.floor(ccpos.Z/16/blocksize))
- for xx,cx in pairs(world) do
- for yy,ch in pairs(cx) do
- local pos2 = Vector2.new(xx,yy)
- local dist2 = (pos2 - cpos).Magnitude
- if dist2 > dist then
- dist = dist2
- farpos = pos2
- farCC = ch
- end
- end
- end
- if farCC then
- farCC.vlfold:Destroy()
- farCC.vfold:Destroy()
- --local chu = world[farpos.X][farpos.Y]
- world[farpos.X][farpos.Y] = nil
- end
- end
- --end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement