|
| 14 Feb 2014 06:28 PM |
wait() players = game.Players:GetChildren() for i = 1,#players do game.Lighting["Knife"]:Clone().Parent = players[i].Backpack end
LongKnife = players:findFirstChild("LongKnife") if LongKnife ~=nil then game.Lighting["LongKnife"]:Clone().Parent = players.Backpack end
Never got this error before. |
|
|
| Report Abuse |
|
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 14 Feb 2014 06:31 PM |
for i,v in pairs(game.Players:GetPlayers()) do game.Lighting.Knife:Clone().Parent = v:WaitForChild("Backpack") if not v.Backpack:FindFirstChild("LongKnife") then game.Lighting.LongKnife:Clone().Parent = v.Backpack end end
Why would you give another one to them if it's already there? ~= means not, so ~= nil means it does exist. |
|
|
| Report Abuse |
|
|
xPoloBear
|
  |
| Joined: 10 Oct 2011 |
| Total Posts: 202 |
|
|
| 14 Feb 2014 06:31 PM |
Why is there a wait() ??
Fixed script:
players = game.Players:GetChildren() for i = 1,#players do game.Lighting["Knife"]:Clone().Parent = players[i].Backpack end
LongKnife = players:findFirstChild("LongKnife") if not LongKnife then game.Lighting["LongKnife"]:Clone().Parent = players[i].Backpack end |
|
|
| Report Abuse |
|
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 14 Feb 2014 06:32 PM |
| Polo I already handled it, and I did it better. |
|
|
| Report Abuse |
|
|
| |
|