I have a script that invokes a remote function from client to server, however it keeps saying argument 1 missing or nil, I am only passing 1 argument which is the client’s camera CFrame. I tried to find some solutions, and I tried printing the CFrame, but it didn’t say it was nil or blank.
This is my script:
LocalScript
local function Shoot(bindName: string, userInputState: Enum.UserInputState)
if userInputState and userInputState ~= Enum.UserInputState.Begin then return end
local registerHit = game:GetService('ReplicatedStorage'):WaitForChild("registerHit")
local cframetopass = workspace.CurrentCamera.CFrame
local hitData : hitdata = registerHit:InvokeServer(cframetopass)
10:56:04.536 Argument 1 missing or nil - Client - LocalScript:58
10:56:04.536 Stack Begin - Studio
10:56:04.536 Script 'Players.coolifysz.Backpack.RaycastGun.LocalScript', Line 58 - function Shoot - Studio - LocalScript:58
10:56:04.536 Script 'Players.coolifysz.Backpack.RaycastGun.LocalScript', Line 105 - Studio - LocalScript:105
10:56:04.536 Stack End - Studio
idk why but ihave feeling that you miss one of this parameters of ContextActionService:BindAction(string , function , boolean , Enum.KeyCode or Enum.UserInputType) ig