I would like this script to target every player in the game except for the local player, idk lua so any help would be very muchly appreciated.
while true do wait(0) local args = { [1] = { [1] = game:GetService("Players").meh_anxiety.Character.HumanoidRootPart } } game:GetService("ReplicatedStorage").Events.SwingTool:FireServer(unpack(args)) end
In a local script:
local Player = game.Players.LocalPlayer local playersTable = {} -- Used to store players for i,v in pairs(game.Players:GetPlayers() do if v ~= Player then table.insert(playersTable, v) end end
To use the table, you will have to use a for
loop:
for i,plr in pairs(playersTable) do -- do something end