Advertisement
ModeratedUsername

Click brick to get item

May 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. local ToolNames = {"Item", "Item", "Item"} --Put any item you want
  2. local Storage = game:GetService("ServerStorage") -- put the item in serverstorage
  3.  
  4.  
  5. local Part = script.Parent
  6. local ClickDetector = Part:WaitForChild("ClickDetector")
  7.  
  8. ClickDetector.MouseClick:connect(function(Player)
  9. if Player and Player.Character then
  10. local Backpack = Player:WaitForChild("Backpack")
  11. for i = 1, #ToolNames do
  12. local Tool = Storage:FindFirstChild(ToolNames[i])
  13. if Tool then
  14. Tool:clone().Parent = Backpack
  15. end
  16. end
  17. end
  18. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement