Advertisement
Nadds

Untitled

Apr 23rd, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. function EnableWeapon(str)
  2. local weapon
  3.  
  4. for _, data in pairs(weapons) do
  5. if str:lower():find(data:lower()) then
  6. weapon = data
  7. end
  8. end
  9.  
  10. if weapon == nil then return end
  11.  
  12. if script:findFirstChild(weapon) then
  13. for _, plr in pairs(game.Players:GetPlayers()) do
  14. script[weapon]:Clone().Parent = plr.Backpack
  15. end
  16. script[weapon].Parent = game.StarterPack
  17. notify("|:ZEO", 5, weapon.Name.." enabled.")
  18. elseif game.StarterPack:findFirstChild(weapon) then
  19. for _, plr in pairs(game.Players:GetPlayers()) do
  20. if plr.Backpack:findFirstChild(weapon) then
  21. plr.Backpack[weapon]:Destroy()
  22. elseif plr.Charatcer:findFirstChild(weapon) then
  23. plr.Character[weapon]:Destroy()
  24. notify("|:ZEO", 5, weapon.Name.." disabled.")
  25. end
  26. end
  27. game.StarterPack[weapon].Parent = script
  28. end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement