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

Why does this script not work?

Asked by 8 years ago

No error at all. I want the script to give the tool to all players.

while true do wait(3) local players = game.Players:GetChildren() if #players >= 1 then local Gun = game.Lighting.Springfield:Clone() Gun.Parent = players.Backpack end end

1 answer

Log in to vote
0
Answered by 8 years ago

You could simply just get the players with a for _,v in pairs(game.Players:GetPlayers()) dostatement like so...

for _,v in pairs(game.Players:GetPlayers()) do
    local Tool = game.Lighting.Springfield
    Tool:Clone().Parent = v.Backpack
end
Ad

Answer this question