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

Why wont this Tool giver script work?

Asked by
iLegitus 130
9 years ago
wait(2)
      sr = game.ReplicatedStorage["TOOL_Drive"].StarterRod:clone()
    for i = 1, #Players do 
        sr.Parent = Players[i].Backpack
    end

(Yes ive made TOOL_Drive inside ReplicatedStorage,Not an error) What that is soppost to do is basically clone the StarterRod,And place it into everyone's starterpack. But its not working for some reason. Can anyone debug?

0
Is Players defined? Spongocardo 1991 — 9y
0
Yes, Players = game.Players:GetChildren() iLegitus 130 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

I suppose you've already defined Players. You're cloning the tool, but you're only doing it once, and not for each player. Try this.

wait(2)
for i = 1, #Players do
    local sr = game.ReplicatedStorage["TOOL_Drive"].StarterRod:Clone() --Clones the tool for the number of players there are.
    sr.Parent = Players[i].Backpack --Puts the clone in their backpack.
end
Ad

Answer this question