I am trying to make a brick give people a linked sword and when people fall through it (cancollide is false) it gives them 10 instead of one, here is the code. Please help.
1 | script.Parent.Touched:connect( function () |
2 | for i, v in pairs (game.Players:GetChildren()) do |
3 | if v.Backpack ~ = nil |
4 | then |
5 | clone = game.Lighting.LinkedSword:Clone() |
6 | clone.Parent = v.Backpack |
7 | end |
8 | end |
9 | end ) |
01 | script.Parent.Touched:connect( function () |
02 | for i, v in pairs (game.Players:GetChildren()) do |
03 | if v.Backpack ~ = nil |
04 | then |
05 | if v.Backpack:FindFirstChild( "LinkedSword" ) = = nil then --will make sure its not in the bag first |
06 | clone = game.Lighting.LinkedSword:Clone() |
07 | clone.Parent = v.Backpack |
08 | end |
09 | end |
10 | end |
11 | end ) |