I want to send a function from a require on a module script, but when the server gets it it just equals nil and cant be used when fired to the other clients, is it even possible to send this?
here in the first script
m1 = require(modulescript.m1)
local data = {action = "weaponattack", char = character, attack = m1}
remote:FireServer(data)
here in the server
remote.OnServerEvent:Connect(function(p, data)
if data.action == "weaponattack" then
for i,player in pairs(game.Players:GetChildren()) do
remote.weaponevents:FireClient(player, data)
end
end
end)
here back in the local script
remote.weaponevents.OnClientEvent:Connect(function(data)
if data.action == "Rweaponm1" then
data.attack.m1(data.char)
end
end)