So I'm making a feature not specifying what feature, But in the MainScript I have a table with every player, So in another script I want to give every player in the table more speed, But I can't figure out how, I tried many things, May anyone help me?
I think you are going to need to post more context, but here is my answer from I can obtain.
Assuming both scripts are server sided:
local event = game.ReplicatedStorage.BindableEvent -- some event you have event.Event:Connect(function(players) for i, player in pairs(players) do local char = player.Character or player.CharacterAdded:Wait() char.Humanoid.WalkSpeed += 10 -- increases speed end end) -- in the main script local event = game.ReplicatedStorage.BindableEvent local players = {} -- your table event:Fire(players) -- this is how you fire the server, call this whenever you need to increase the speed
The most efficient option is to use ModuleScripts, as you can then access tables directly (if you put the table in what is returned by the Module), example:
Module Script:
local module = {} local someTable = {} module.SomeTable = someTable -- can use someTable here return module
Script:
local Module = require(path.to.module.script.here) -- You can now use Module.SomeTable here