Fusion 4, button event showing error

I’m trying to create an event on a button component using Fusion. The same code worked a couple months ago but now its not, what am i doing wrong?

[fusion.OnEvent("Activated")] = function(_, clicks)
	if props.Event.Activated ~= nil then
		props.Event.Activated(clicks)
	end
end,

These are some of the things its saying is wrong

Here is the link to the Fusion documentation that explains how to create a button with an event. I’ve tried doing the exact same thing and it keeps erroring so I’m not sure what i should do next.

try without the fusion.OnEvent()

Try just OnEvent(“Activated”)

The OnEvent you mention refers to fusion.OnEvent makes no difference whether I state it at the beginning of the script or in the instantiation; however, I did try it to rule it out completely, and it did, in fact, not change anything. Any other ideas?

It turns out that one of the extensions I was using, called “Selene” - a Lua linter, didn’t like how it was formatted, but I was able to resolve the issue.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.