Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function EnableWeapon(str)
- local weapon
- for _, data in pairs(weapons) do
- if str:lower():find(data:lower()) then
- weapon = data
- end
- end
- if weapon == nil then return end
- if script:findFirstChild(weapon) then
- for _, plr in pairs(game.Players:GetPlayers()) do
- script[weapon]:Clone().Parent = plr.Backpack
- end
- script[weapon].Parent = game.StarterPack
- notify("|:ZEO", 5, weapon.Name.." enabled.")
- elseif game.StarterPack:findFirstChild(weapon) then
- for _, plr in pairs(game.Players:GetPlayers()) do
- if plr.Backpack:findFirstChild(weapon) then
- plr.Backpack[weapon]:Destroy()
- elseif plr.Charatcer:findFirstChild(weapon) then
- plr.Character[weapon]:Destroy()
- notify("|:ZEO", 5, weapon.Name.." disabled.")
- end
- end
- game.StarterPack[weapon].Parent = script
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement