Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(edited) passed value is not a function???

Asked by 4 years ago
Edited 4 years ago

okay, I have had this error before but I CANNOT seem to fix it. it seems to end the function perfectly.
if anyone can get out their brains and tell me what this error means so I can fix it myself, I would be set to make my program work. thanks!

EDIT: this a long script and I won't provide context, but I can give the error message and when it occurs. Error: 17:00:12.316 - Attempt to connect failed: Passed value is not a function 17:00:12.318 - Stack Begin 17:00:12.319 - Script 'Plugin_-1.virafinder.Script', Line 273 - function startgui 17:00:12.320 - Stack End
occurs when trying to call with connecting: dockWidget.menu.Fscan.MouseButton1Click:Connect(scan("F"))

0
Please provide some code or context, otherwise we can't help. User#25069 0 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

It means it needs a passed value that is a function and not any other datatype. Most likely the result of trying to set up a connection but you pass something or nil rather than a function inside of it.

I can recreate the error like this

game.Players.PlayerAdded:Connect(Added) --//It doesn't know what "Added" is, so it returns nil instead of the function

function Added(Player)
    print(Player.Name .. " Joined!")
end

--//Output: Attempt to connect failed: Passed value is not a function

That's all I can come up with without you providing any code.

Ad
Log in to vote
0
Answered by 4 years ago

code must be this because you cant connect a function with an input without doing this:

dockWidget.menu.Fscan.MouseButton1Click:Connect(function()
            scan("F")
        end)

Answer this question