So, I've been trying to make a script which simply affects all players Ive tried localplayer and so forth but does not seem to be working can someone please tell me another way?
COMMUNITY QUESTION
How can I make a script which specifiys all Players in a game and for example give them sparkles?
1 answer
Well, you would need to access all players at once, so you'd use something like this
for i, player in ipairs(game.Players:GetPlayers()) do
end
That accesses all the players.
If you were putting sparkles, then you would put a sparkle object in replicatedstorage for example, and clone().parent it to the players character.
so you would implement this like so
repstorage = game.ReplicatedStorage
sparkle = repstorage.Sparkles
for i, player in ipairs(game.Players:GetPlayers()) do
if player.Character then
sparkle:Clone().Parent = player.Character
end
end
that adds sparkles to all characters.
So you can modify that code for whatever you need.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks.