Ok, so. What an Inconvenience for this to happen while the game physics are smooth and exquisite. I, played run the game for Line 32 to appear as an Error. As a Programmer, I was completely clueless as to what the error was. any of you know what the problem is here?
The current way you are doing it is kinda inefficient, since you are using a for loop to go through numbers instead of a table, below is the code that you can replace that with to make this a bit simpler.
But with the error, the only thing I know it could be is the improper capitalization. Its :GetPlayers() instead of .getPlayers.
transceiver.OnServerEvent:Connect(function(player, data)
for i,v in pairs(game.Players:GetPlayers()) do
if v.Name ~= player.Name then
local Info = {player.Name, data}
transceiver:FireClient(v, info)
end
end
end)
Not just that, it’s a function called with a colon operator. When you call a function of a table/whatever with a colon, it’s the equivalent to calling that function with the table/whatever as the first argument. This means that players:GetPlayers() is the same as players.GetPlayers(players).
Alright, thanks you. I am just trying to figure it out because, the game concept is an FPS game. When the player loads in they don’t load at the specific spawn point given. Looking back at the script there was an error and I had no clue as to what it was. So, I appreciate this guidance and help on my behalf! God bless you.
Since you are getting the players it cant be .getPlayers because of many reasons. One it must have a colon because it is called with a colon operator. Second because G must be capital.
If you don’t understand than I will explain. When we say game.Players we are defining the player service which stores all the players. :GetPlayers() gets all the players in the service.