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?
On your 3rd line, you put an if statement that was not needed at all.
if Input.ImportName:Connect(function(hitname)
Functions do not use an if statement to work, whether this was an accident or not I just want to make sure you understand the problem.