How do you guys use btnFuncs?

on my first map, btnFuncs worked, but when I modified it, it doesn’t seem to work anymore. Here’s an example of a btnFuncs script that I do

local Lib = workspace.Multiplayer.GetMapVals:Invoke() --Has: Map, Script, Button, btnFuncs
Lib.Button:connect(function(p, bNo) if Lib.btnFuncs[bNo] then Lib.btnFuncs[bNo](bNo, p) end end)


Lib.btnFuncs(1) = function()
    Lib.Script.moveWater(Lib.Map.Intro._Door1, Vector3.new(0, -30, 0), 1, true)
end


wait(60)
Lib.Script.setWaterState(Lib.Map.Intro._Water1, "acid")
wait(15)
Lib.Script.setWaterState(Lib.Map.Intro._Water1, "lava")
wait(3)
Lib.Script.moveWater(Lib.Map.Intro._Water1, Vector3.new(0, 30, 0), 10, true)

any mistakes?

This part is missing at Lib.btnFuncs.

 = function()

i messed up, i forgot to add that when i was creating the topic

Lib.btnFuncs[1] = function()

Change the () to []

and the ) at this one is forgotten.
Lib.Script.moveWater(Lib.Map.Intro._Door1, Vector3.new(0, -30, 0), 1, true

thanks

What was that palm face video for?

because it was a tiny mistake he made (from his POV)

4 Likes