Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there a better way to send a table from module script to server script?

Module script:

return {
unkickablePlayers = {  -- Caps lock sensitive / Players who cannot be banned or kicked
"aaa";
"bbb";
};  
}

Server script:

local requirement = require(script.Parent)
local unkickableplayers = {}
for _, v in ipairs(requirement.unkickablePlayers) do
	table.insert(unkickableplayers, v)
end

I want to know if there is a better way than what I have done. There's not much more to my question.

This does work, I just want a better way to do it.

2 comments

0

Maybe local unkickableplayers = require(script.Parent)[1] ? I dunno

0

@Block what?

1 answer

✓ Accepted answer

Remore events Module script:

game:GetService("ReplicatedStorage").RemoteEvent:Fire(unkickablePlayers)

Script:

game:GetService("ReplicatedStorage").RemoteEvent.OnServerEvent:Connect(function(plr, unKickablePlayers)

smth like that if it does not work use a localscript with FireServer sending it to the module script and then you will be able to send it to the script with .OnServerEvent

This discussion is preserved as it was. New answers, comments, and votes are closed.