Hello, I am making a survival game and it has a crafting table. I found a way to make it function but I believe there could be an easier way, let's say I could make recipes within an array. Is this possible?
Current code [LocalScript]
local sl1 = script.Parent.Slot1.Item
local sl2 = script.Parent.Slot2.Item
local sl3 = script.Parent.Slot3.Item
local sl4 = script.Parent.Slot4.Item
local result = script.Parent.ResultImage
local ingreds = {
"Sticks",
'Logs',
'Rocks',
}
while wait() do
--CraftingTable
if sl1.Value == ingreds[1] and sl2.Value == ingreds[1] and sl3.Value == ingreds[1] and sl4.Value == ingreds[1] then
result.Image = 'http://www.roblox.com/asset/?id=151913757'
else
result.Image = ''
end
------
end

1 comment
u could make the slots in a table also?