I'm not sure what to say about how your script works as you haven't really provided much,
but for functions, regardless of the existence of arguments or not, you still need dual parenthesis after your function keyword, such as function name(), rather than function name. Otherwise, the Lua interpreter will fail.
Fixed:
local Motor = script.Parent.Parent.Parent.Workspace.MOTOR.BackSurfaceInput
function onClicked()
Motor = "Constant"
end
You should also define your BSI when you change it, or you could experience an error. And why not use game.Workspace.MOTOR rather than a line of parents?
Fixed again:
local Motor = game.Workspace.MOTOR
function onClicked()
Motor.BackSurfaceInput = "Constant"
end
Also, how are you calling this function? Is this all of your script, or is just a snippet you need help with?
2 comments
You are missing Parentheses.
what you mean?