georgeba
|
  |
| Joined: 29 Oct 2011 |
| Total Posts: 1092 |
|
|
| 25 Nov 2013 07:37 PM |
| I have a giver, how would I make it only give 1 weapon when you touch it so you can't keep getting swords each time you touch it. Thanks! |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2013 07:38 PM |
| Make it check if you already have a sword in your Backpack before giving them the sword. |
|
|
| Report Abuse |
|
|
georgeba
|
  |
| Joined: 29 Oct 2011 |
| Total Posts: 1092 |
|
| |
|
|
| 25 Nov 2013 07:41 PM |
script.Parent.Touched:connect(function(p) if p.Parent:FindFirstChild("Humanoid") then if game.Players:FindFirstChild(p.Parent.Name).Backpack:FindFirstChild("Sword") then print("Already has sword") else game.Lighting.Sword:Clone().Parent = game.Players:FindFirstChild(p.Parent.Name) end end end)
Try that, I'm a little rusty. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2013 07:42 PM |
Change
game.Lighting.Sword:Clone().Parent = game.Players:FindFirstChild(p.Parent.Name)
to
game.Lighting.Sword:Clone().Parent = game.Players:FindFirstChild(p.Parent.Name).Backpack |
|
|
| Report Abuse |
|
|
georgeba
|
  |
| Joined: 29 Oct 2011 |
| Total Posts: 1092 |
|
| |
|
georgeba
|
  |
| Joined: 29 Oct 2011 |
| Total Posts: 1092 |
|
| |
|
georgeba
|
  |
| Joined: 29 Oct 2011 |
| Total Posts: 1092 |
|
|
| 25 Nov 2013 07:45 PM |
| Still gives me more than 1 sword |
|
|
| Report Abuse |
|
|