Hello! I’ve recently just started working with RemoteFunctions, but I am having problems sending parameters from the client on my InvokeServer and retrieving them back on the server.
There is probably a fairly simple fix, however, looking at the Developer Hub documentation did not help me much.
Here is my code,
-- Local Script
local remoteResponse = SystemRemotes:WaitForChild('CheckIn'):InvokeServer(UserTextBox.Text, Players.LocalPlayer.Name, 'Standard')
-- Module Scripts (Functions)
function api.checkIn(Player, Employee, Type)
for _,Doors in pairs(game.Workspace.CM_Doors:GetDescendants()) do
if require(script).checkForOwnership(Player) == true then
warn('You already own a room!')
return false
elseif Doors:IsA('StringValue') and Doors:FindFirstChild('Type') then
if Doors.Value == Type then
Doors.Parent.Owner.Value = Player
return true
end
end
end
end
-- Server Script--
-- // Modules
local API = require(SystemPackages:WaitForChild('API'))
local Settings = require(SystemPackages:WaitForChild('Settings'))
-- // Script
SystemRemotes:WaitForChild('CheckIn').OnServerInvoke = API.checkIn()
Basically, when I watch for the server invoke, I want to add my parameters from the local script inside to my checkIn function (eg: API.checkIn(‘ItsNickBoi110’, ‘Noob’, 'Standard")
Any help would be appreciated, thanks!