Advertisement
HowToRoblox

AddArmor

Feb 25th, 2023
1,128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. local armorpieces = game:GetService("ReplicatedStorage"):WaitForChild("ArmorPieces")
  2.  
  3.  
  4. function addFunc(plr:Player, armor:Model) --Adding a new armor to a player's inventory
  5.    
  6.     local char = plr.Character
  7.    
  8.     if char and char:FindFirstChild("Humanoid") and char.Humanoid.Health > 0 then
  9.        
  10.         local inv = plr:WaitForChild("ArmorInventory")
  11.        
  12.         if armor.Parent.Parent == armorpieces then
  13.             armor:Clone().Parent = inv
  14.         end
  15.     end
  16. end
  17.  
  18. return addFunc
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement