I tried to call a function from a module script and it gives an error called “Argument 2 missing or nil”
LocalScript:
local module = require(game.ReplicatedStorage.Drone)
local drone = game.StarterPlayer.StarterCharacter
local ContextActionService = game:GetService("ContextActionService")
local newDrone = module.new(drone)
ContextActionService:BindAction("Forwards", module.forward, false, Enum.PlayerActions.CharacterForward)
It misses in the Bind Action but whenever I add the parentheses back It says attempt to call a nil value. Is this about me printing the function and getting nil?
Edit: I believe this is because I’m using OOP and adding self as an argument?
Your function probably requires values and this is where u put your values…
Exp: module.forward(button)
the button is an instance in this example that you want to transfer to the function in the module script.