|
heres one of them:
ZSP = script.Parent.Parent.Parent.Name
wait(1)
local tool = script.Parent
local frame = tool.Frame
local label = frame.Label
local list = frame.List
local createTool = frame.CreateTool
local createItem = frame.CreateItem
local processItem = frame.Process
local clear = frame.Clear
local ingTable = {}
function getDist(a, b)
return (a - b).magnitude
end
function checkIngTable(part)
for index, child in pairs(ingTable) do
if part == child then
return true
end
end
return false
end
function ing(index)
local ing = ingTable[index]
if ing ~= nil then
return ing.Name
else
return ""
end
end
function ingReal(index)
local ing = ingTable[index]
if ing ~= nil then
return ing
end
end
function saveIng(index)
local ing = ingReal(index)
if ing ~= nil then
table.remove(ingTable, index)
end
end
function setListName()
for index, child in pairs(ingTable) do
if index == 1 then
list.Text = child.Name
else
list.Text = list.Text..", "..child.Name
end
end
end
function alert(text)
delay(0, function()
for num = 1, 20 do
label.Text = text
wait()
end
end)
end
function clearTable()
ingTable = {}
list.Text = ""
end
function deleteTable()
for index, child in pairs(ingTable) do
child:remove()
end
clearTable()
end
function choices(choiceTab)
local buttons = tool.Parent.Parent.PlayerGui.ScreenGui:GetChildren()
for index, child in pairs(buttons) do
if child.Name == "ChoiceButton" then
child:remove()
end
end
local clicked = nil
local buttonText = ""
local buttonTab = {}
for index, child in pairs(choiceTab) do
local button = Instance.new("TextButton")
button.Position = UDim2.new(0.5, 0, index * 0.05 - 0.05)
button.Size = UDim2.new(0.1, 0, 0.05, 0)
button.BackgroundColor3 = Color3.new(1, 1, 1)
button.Name = "ChoiceButton"
button.Text = child
button.MouseButton1Down:connect(function() clicked = button print("Picked a choice") end)
button.Parent = tool.Parent.Parent.PlayerGui.ScreenGui
table.insert(buttonTab, button)
end
while clicked == nil do
wait()
print("Looped")
end
buttonText = clicked.Text
for index, child in pairs(buttonTab) do
child:remove()
end
return buttonText
end
function makeTool()
local made = ""
if ing(1) == "Burning Metal" and ing(2) == "" then
made = "Metal Bar"
end
if ing(1) == "Scrap Metal" then
made = "Rusty Metal Bar"
end
if ing(1) == "Pistol" then
made = "Pistol"
end
if ing(1) == "Rifle" then
made = "Rifle"
end
if ing(1) == "Hammer" then
made = "Hammer"
end
if ing(1) == "Fishing Pole" then
made = "Fishing Pole"
end
if ing(1) == "Burining Metal" and ing(2) == "Rope" then
made = "Metal Bucket"
end
if ing(1) == "Stock Wood" and ing(2) == "Nail" then
made = "Nailed Wood"
end
if ing(1) == "Discarded Plastic" and ing(2) == "Gasoline" then
made = "Faulty Lighter"
end
if ing(1) == "Battery" and ing(2) == "Wire" then
made = "FlashLight"
end
if ing(1) == "Wire" and ing(2) == "Wire" and ing(3) == "Battery" then
made = "Tazer"
end
if ing(1) == "Battery" and ing(2) == "Wire" and ing(3) == "Wire" then
made = "CellPhone"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Tied Metal Bar" and ing(3) == "Wooden Barricade" then
made = "Small Shelter"
end
if ing(1) == "Wooden Barricade" and ing(2) == "Tied Metal Bar" and ing(3) == "Glass Pane" then
made = "Garage"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Tied Metal Bar" and ing(3) == "Gasoline" then
made = "Rusty Car"
end
if ing(1) == "Gasoline" and ing(2) == "Tied Metal Bar" and ing(3) == "Tied Metal Bar" then
made = "Rusty Truck"
end
if ing(1) == "Bonded Metal Bar" and ing(2) == "Scrap Metal" and ing(3) == "Wooden Barricade" then
made = "Large House"
end
if ing(1) == "Bonded Metal Bar" and ing(2) == "Tied Metal Bar" and ing(3) == "Wooden Barricade" then
made = "Armored Wall"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Scrap Metal" and ing(3) == "Wooden Barricade" then
made = "Small Home"
end
if ing(1) == "Bonded Metal Bar" and ing(2) == "Bonded Metal Bar" and ing(3) == "Scrap Metal" and ing(4) == "Wooden Barricade" and ing(5) == "Glass Pane" then
made = "Hotel"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Tied Metal Bar" and ing(3) == "Tied Metal Bar" and ing(4) == "Wooden Barricade" and ing(5) == "Glass Pane" then
made = "Med. Shelter"
end
if ing(1) == "Pure Plastic" and ing(2) == "Gasoline" then
made = "Plastic Lighter"
end
if ing(1) == "Pure Plastic" and ing(2) == "Gasoline" and ing(3) == "Stock Wood" then
made = "Lighter Kit"
end
if ing(1) == "Pure Plastic" and ing(2) == "Pure Plastic" and ing(3) == "Gasoline" then
made = "Gas Container"
end
if ing(1) == "Wooden Barricade" and ing(2) == "Wooden Barricade" and ing(3) == "Scrap Metal" then
made = "Self Storage"
end
if ing(1) == "Wooden Barricade" and ing(2) == "Wooden Barricade" and ing(3) == "Metal Bar" then
made = "Gun Storage"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Tied Metal Bar" and ing(3) == "Scrap Metal" and ing(4) == "Wooden Barricade" then
made = "Warehouse"
end
if ing(1) == "Battery" and ing(2) == "Wire" and ing(3) == "Brick Barricade" and ing(4) == "Tied Metal Bar" then
made = "Electric Brick Gate"
end
if ing(1) == "Wire" and ing(2) == "Battery" and ing(3) == "Brick Barricade" and ing(4) == "Tied Metal Bar" then
made = "Electric Brick Wall"
end
if ing(1) == "Wire" and ing(2) == "Battery" and ing(3) == "Stock Wood" and ing(4) == "Stock Wood" then
made = "Electric Fence"
end
if ing(1) == "Wire" and ing(2) == "Battery" and ing(3) == "Brick Barricade" and ing(4) == "Tied Metal Bar" and ing(5) == "Glass Pane" then
made = "Electric Brick Shelter"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Tied Metal Bar" and ing(3) == "Wooden Barricade" and ing(4) == "Stock Wood" then
made = choices({"Makeshift Gate", "Dock"})
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Wooden Barricade" and ing(3) == "Wooden Barricade" and ing(4) == "Wooden Barricade" then
made = "Makeshift Wall"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Stock Wood" and ing(3) == "Stock Wood" then
made = "Ladder"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Wooden Barricade" and ing(3) == "Stock Wood" then
made = "Makeshift Mill"
end
if ing(1) == "Stock Wood" and ing(2) == "Stock Wood" then
made = "Makeshift Raft"
end
if ing(1) == "Bonded Metal Bar" and ing(2) == "Bonded Metal Bar" and ing(3) == "Bonded Metal Bar" and ing(4) == "Wooden Barricade" then
made = "Stable Tower"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Tied Metal Bar" and ing(3) == "Tied Metal Bar" and ing(4) == "Wooden Barricade" then
made = "Makeshift Tower"
end
if ing(1) == "Bonded Metal Bar" and ing(2) == "Bonded Metal Bar" and ing(3) == "Wooden Barricade" and ing(4) == "Wooden Barricade" and ing(5) == "Stock Wood" and ing(6) == "Glass Pane" then
made = "Large Shelter"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Tied Metal Bar" and ing(3) == "Wooden Barricade" and ing(4) == "Wooden Barricade" and ing(5) == "Stock Wood" and ing(6) == "Glass Pane" then
made = "Mansion"
end
if ing(1) == "Bonded Metal Bar" and ing(2) == "Pile of Bricks" and ing(3) == "Pile of Bricks" and ing(4) == "Pile of Bricks" and ing(5) == "Glass Pane" then
made = "Brick Fort"
end
if ing(1) == "Wooden Barricade" and ing(2) == "Pile of Bricks" and ing(3) == "Pile of Bricks" and ing(4) == "Pile of Bricks" and ing(5) == "Glass Pane" then
made = "Brick Wall"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Tied Metal Bar" and ing(3) == "Scrap Metal" and ing(4) == "Wooden Barricade" and ing(5) == "Stock Wood" then
made = "Large Warehouse"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Scrap Metal" and ing(3) == "Pile of Sand" then
made = "Sand Water Filter"
end
if ing(1) == "Pile of Bricks" and ing(2) == "Pile of Bricks" and ing(3) == "Scrap Metal" and ing(4) == "Stock Wood" and ing(5) == "Stock Wood" then
made = "Forge"
end
if ing(1) == "Tied Metal Bar" and ing(2) == "Glass Pane" and ing(3) == "Glass Pane" then
made = "Green House"
end
if ing(1) == "Bonded Metal Bar" and ing(2) == "Bonded Metal Bar" and ing(3) == "Wooden Barricade" and ing(4) == "Stock Wood" then
made = "Stable Gate"
end
if ing(1) == "Bonded Metal Bar" and ing(2) == "Wooden Barricade" and ing(3) == "Wooden Barricade" and ing(4) == "Wooden Barricade" then
made = "Stable Wall"
end
if ing(1) == "Bonded Metal Bar" and ing(2) == "Wooden Barricade" and ing(3) == "Stock Wood" then
made = "Stable Mill"
end
if ing(1) == "Wooden Barricade" and ing(2) == "Wooden Barricade" and ing(3) == "Wooden Barricade" then
made = "Big Raft"
end
if ing(1) == "Pistol" and ing(2) == "Pistol" and ing(3) == "Pistol" then
made = "Rifle"
end
if ing(1) == "Pistol" and ing(2) == "Ammo Pack" and ing(3) == "Stock Wood" then
made = "Gun Kit"
end
if ing(1) == "Fertile Soil" and ing(2) == "Stock Wood" and ing(3) == "Stock Wood" then
made = "Farming Kit"
end
if ing(1) == "Pistol" and ing(2) == "Pistol" and ing(3) == "Scrap Metal" then
made = "870 Combat"
end
if ing(1) == "Pistol" and ing(2) == "Scrap Metal" then
made = "GOL-SM"
end
local real = game.Lighting.Tools:findFirstChild(made)
if real ~= nil then
local player = tool.Parent.Parent
local given = real:clone()
given.Parent = player.Backpack
alert(given.Name.." created!")
deleteTable()
else
alert("Nothing created...")
end
clearTable()
end
function makeItem()
local made = ""
if ing(1) == "Stock Wood" and ing(2) == "Stock Wood" then
made = "Wooden Barricade"
end
if ing(1) == "Pile of Bricks" and ing(2) == "Pile of Bricks" then
made = "Brick Barricade"
end
if ing(1) == "Scrap Metal" and ing(2) == "Scrap Metal" then
made = "Tied Metal Bar"
end
if ing(1) == "Burning Metal" and ing(2) == "Burning Metal" then
made = "Bonded Metal Bar"
end
if ing(1) == "Glass" and ing(2) == "Glass" then
made = "Glass Pane"
end
if ing(1) == "Wheat" and ing(2) == "Wheat" then
made = "Wheat Bundle"
end
if ing(1) == "Stalk" then
made = "Rope"
end
if ing(1) == "Dough" and ing(2) == nil then
made = "Uncooked Bread"
end
if ing(1) == "Dough" and ing(2) == "Corn" then
made = "Uncooked Corn Bread"
end
if ing(1) == "Dough" and ing(2) == "Pumpkin" then
made = "Uncooked Pumpkin Pie"
end
local real = game.Lighting.Items:findFirstChild(made)
if real ~= nil then
local player = tool.Parent.Parent
if player.Inventory.One.Value == nil then
local given = real:clone()
given.Parent = player.Inventory
player.Inventory.One.Value = given
alert(given.Name.." created!")
deleteTable()
elseif player.Inventory.Two.Value == nil then
local given = real:clone()
given.Parent = player.Inventory
player.Inventory.Two.Value = given
alert(given.Name.." created!")
deleteTable()
elseif player.Inventory.Three.Value == nil then
local given = real:clone()
given.Parent = player.Inventory
player.Inventory.Three.Value = given
alert(given.Name.." created!")
deleteTable()
elseif player.Inventory.Four.Value == nil then
local given = real:clone()
given.Parent = player.Inventory
player.Inventory.Four.Value = given
alert(given.Name.." created!")
deleteTable()
elseif player.Inventory.Five.Value == nil then
local given = real:clone()
given.Parent = player.Inventory
player.Inventory.Five.Value = given
alert(given.Name.." created!")
deleteTable()
elseif player.Inventory.Six.Value == nil then
local given = real:clone()
given.Parent = player.Inventory
player.Inventory.Six.Value = given
alert(given.Name.." created!")
deleteTable()
elseif player.Inventory.Seven.Value == nil then
local given = real:clone()
given.Parent = player.Inventory
player.Inventory.Seven.Value = given
alert(given.Name.." created!")
deleteTable()
elseif player.Inventory.Eight.Value == nil then
local given = real:clone()
given.Parent = player.Inventory
player.Inventory.Eight.Value = given
alert(given.Name.." created!")
deleteTable()
elseif player.Inventory.Nine.Value == nil then
local given = real:clone()
given.Parent = player.Inventory
player.Inventory.Nine.Value = given
alert(given.Name.." created!")
deleteTable()
elseif player.Inventory.Ten.Value == nil then
local given = real:clone()
given.Parent = player.Inventory
player.Inventory.Ten.Value = given
alert(given.Name.." created!")
deleteTable()
elseif player.Inventory.Ten.Value ~= nil then
alert("Not Enough Space!!")
wait(1.5)
end
else
alert("Nothing created...")
end
clearTable()
end
function process()
local hasCreated = false
if ing(1) == "Small Leaves" and ing(2) == "" then
addToService("Composting", ingReal(1))
alert("Began Composting!")
hasCreated = true
end
if ing(1) == "Large Leaves" and ing(2) == "" then
addToService("Composting", ingReal(1))
alert("Began Composting!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Beef Jerky Seed" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Beef Jerky Seed!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Wheat Seed" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Wheat!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Corn" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Corn!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Grape" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Grape!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Pumpkin Seed" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Pumpkin!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Pumpkin Seed Pack" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Pumpkin!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Corn Seed Pack" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Corn!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Carrot Seed Pack" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Carrot!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Grape Seed Pack" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Grape!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Wheat Seed Pack" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Wheat!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Carrot Flower" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Carrot!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Apple" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Apple!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Blueberry" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted Berry!")
hasCreated = true
end
if ing(1) == "Fertile Soil" and ing(2) == "Zombie Seed" then
plant(ingReal(1), ingReal(2))
addToService("Farming", ingReal(2))
alert("Planted A Brain Eating Zombie Plant!")
hasCreated = true
ZSPALERT = Instance.new("StringValue")
ZSPALERT.Parent = workspace.Services.Farming
ZSPALERT.Value = ZSP
end
if ing(1) == "Bento Hide" and ing(2) == "" then
addToService("Tanning", ingReal(1))
alert("Began Tanning!")
hasCreated = true
end
if not hasCreated then
alert("Nothing happened...")
end
clearTable()
end
function plant(compost, seed)
seed.Locked = true
seed.Anchored = true
compost.Locked = true
seed.CFrame = compost.CFrame
local val = Instance.new("ObjectValue")
val.Name = "MyCompost"
val.Value = compost
val.Parent = seed
end
function addToService(serviceName, part)
local ov = Instance.new("ObjectValue")
ov.Value = part
ov.Parent = game.Workspace.Services:findFirstChild(serviceName)
end
function canCraft(targ)
local criteria1 = (not targ.Locked)
local criteria2 = (targ:findFirstChild("CanCraft") ~= nil)
return (criteria1 or criteria2)
end
function onSelected(mouse)
local player = tool.Parent.Parent
frame.Parent = player.PlayerGui.ScreenGui
mouse.Move:connect(function()
local targ = mouse.Target
local player = tool.Parent.Parent
local char = player.Character
local head = char.Head
label.Text = ""
if targ ~= nil then
if canCraft(targ) then
if getDist(head.Position, mouse.hit.p) < 15 then
label.Text = targ.Name
end
end
end
end)
mouse.Button1Down:connect(function()
local char = player.Character
local head = char.Head
local targ = mouse.Target
if targ ~= nil then
if canCraft(targ) then
if getDist(head.Position, mouse.hit.p) < 15 then
if not checkIngTable(targ) then
table.insert(ingTable, targ)
setListName()
else
alert("You already have that!")
end
end
end
end
end)
end
function onDeselected()
frame.Parent = tool
if example ~= nil then
example.Parent = nil
end
local buttons = tool.Parent.Parent.PlayerGui.ScreenGui:GetChildren()
for index, child in pairs(buttons) do
if child.Name == "ChoiceButton" then
child:remove()
end
end
end
tool.Selected:connect(onSelected)
tool.Deselected:connect(onDeselected)
clear.MouseButton1Down:connect(function()
clearTable()
local buttons = tool.Parent.Parent.PlayerGui.ScreenGui:GetChildren()
for index, child in pairs(buttons) do
if child.Name == "ChoiceButton" then
child:remove()
end
end
end)
createTool.MouseButton1Down:connect(makeTool)
createItem.MouseButton1Down:connect(makeItem)
processItem.MouseButton1Down:connect(process) |