Er1x_Official

Click to pickup tool roblox

Oct 3rd, 2021
1,546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. local tool = script.Parent
  2. local click = script.Parent.Handle.ClickDetector
  3. local maxActivation = 15 -- max activation distance
  4.  
  5. -- functions
  6. click.MouseClick:Connect(function(player)
  7.     tool.Parent = player.Character -- put the tool in the players character when clicked
  8.     click.MaxActivationDistance = 0
  9. end)
  10.  
  11. workspace.ChildAdded:Connect(function(v) -- check if the tool was dropped
  12.     if v == tool then -- check if the item dropped was the tool
  13.         click.MaxActivationDistance = maxActivation -- make it clickable again
  14.     end
  15. end)
Advertisement
Add Comment
Please, Sign In to add comment