i was creating a system where you can combine different ingredients with other ingredients, but while i was coding it, i got this error:
also, the script is in an part names apple, which is inside a folder name grabbable
heres the script ive been coding:
local addedon = {"Apple", "Nothing", "Nothing"}
local eventtext = script.Parent:FindFirstChild("EventFrame"):FindFirstChild("EventType")
eventtext.Text = "Grab " .. addedon[1] " + " .. addedon[2] " + " .. addedon[3]
local function AddNewAddedon(name)
local alreadyadded = false
for i = 1, #addedon do
if addedon[i] == "Nothing" and alreadyadded == false then
addedon[i] = name
eventtext.Text = "Grab " .. addedon[1] " + " .. addedon[2] " + " .. addedon[3]
return true
else
if i == 3 then
return false
end
end
end
end
if AddNewAddedon("Banana") then
print("yes")
else
print("no")
end