WolfGamesProgrammer

Get Box

Apr 15th, 2024
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | Source Code | 0 0
  1. function OnClick(plr)
  2.     local canGet = true
  3.     if plr.Team == game.Teams["Грузчики"] then
  4.         for _, i in pairs(plr.Backpack:GetChildren()) do
  5.             if i.Name == "Box" then
  6.                 canGet = false
  7.             end
  8.         end
  9.         if canGet then
  10.             local Box = game.ReplicatedStorage.Backpack.Box:Clone()
  11.             Box.Parent = plr.Backpack
  12.         end
  13.     end
  14. end
  15. script.Parent.ClickDetector.MouseClick:Connect(OnClick)
Advertisement
Add Comment
Please, Sign In to add comment