This will help you understand:
I am trying to make a script that will get string values or the name of the value from a custom database. and if the action happens from my script you will see printed output.
Problem:
Every single time i see this error: Workspace.Me.Script:15: Expected 'then' when parsing if statement, got 'end'
My code:
function Input_is_Action(Input,ImportName,Output)
for i,things in pairs(script.Parent.Database:GetChildren()) do
if Input.ImportName:Connect(function(hitname)
if hitname.Name == things.Value or things.Name then
print("Object in database found!")
print("Now doing Action:")
print(Output)
wait(0.1)
else
print("Nothing Found!")
end
end)
end
Input_is_Action(workspace.Start,Touched(),"point")
is there a reason why i get the Error? if so how would i fix it?

2 comments
Correct, just use
Input.ImportName:Connect(function(hitname)Thx 8oe&krowten024nabrU