Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a script which specifiys all Players in a game and for example give them sparkles? [closed]

Asked by 7 years ago
Edited 7 years ago

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?

Closed as Non-Descriptive by hiimgoodpack, abnotaddable, and PyccknnXakep

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 7 years ago

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.

0
Thanks. SpinnyWinny 0 — 7y
Ad