Advertisement
Sungmingamerpro13

Tool ClickScript

Oct 6th, 2022
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. local Tool = script.Parent.Parent
  2.  
  3. script.Parent.ClickDetector.MouseHoverEnter:Connect(function()
  4. if not script.Parent:FindFirstChild("SelectionBox") then
  5. local Select = Instance.new("SelectionBox")
  6. Select.Adornee = script.Parent
  7. Select.Parent = script.Parent
  8. Select.Color3 = Color3.new(1, 1, 1)
  9. Select.Transparency = 0.5
  10. end
  11. end)
  12.  
  13. script.Parent.ClickDetector.MouseHoverLeave:Connect(function()
  14. if script.Parent:FindFirstChild("SelectionBox") then
  15. script.Parent.SelectionBox:Destroy()
  16. end
  17. end)
  18.  
  19. local function Click(player)
  20. Tool.Parent = workspace[player.Name]
  21. end
  22.  
  23. script.Parent.ClickDetector.MouseClick:Connect(Click)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement