I’ve been trying for quite a bit now to create Client-Server communication through with Module scripts through a remote event that is fired first from the client and a normal server script recieves the information. From there the server script sends over all the variables to a server module to do whatever it got to do but no matter what I do the Server-Server communication only sends one variable and makes the other one nil no matter how much I change around the variables, or whether I send them over a table or not. This is what I’ve been trying so far.
- First Client-Server communication | Client Module
local location = mouse.Hit -- Mouse variable exists in my actual script, it does not return nil.
actorCall:FireServer("Wire", location, "Throw") -- Firing the remote event through the client
- Server-Server communication | Normal server script
actorCall.OnServerEvent:Connect(function(Player : Player, Ability : string, ...)
local chr = Player.Character
-- Note! When printing print(...) all variables are sent correctly.
local MovesetModule = require(movesets:FindFirstChild(chr:GetAttribute("Role")):FindFirstChild(chr:GetAttribute("Character")))
MovesetModule[Ability](...)
end)
- What the server recieves | Server Module
function Server:Wire(Pos, Mode)
print(Pos, Mode) -- Prints mode as nil in this instance.
local chr = Player.Character
local root : BasePart = chr:FindFirstChild("HumanoidRootPart")
local direction = (Pos.Position - root.Position).Unit
-- etc etc...
end