Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --!nolint
- local UserInputService = game:GetService("UserInputService")
- local MouseMovementConnection
- local function OnInputChanged(Input)
- if Input.UserInputType ~= Enum.UserInputType.MouseMovement then
- return
- end
- print("This will only print when you have the tool equipped")
- end
- local function onEquipped()
- MouseMovementConnection = UserInputService.InputChanged:Connect(OnInputChanged)
- end
- local function onUnequipped()
- selectionBox.Adornee = nil
- MouseMovementConnection:Disconnect()
- end
- script.Parent.Activated:Connect(onActivated)
- script.Parent.Equipped:Connect(onEquipped)
- script.Parent.Unequipped:Connect(onUnequipped)
Advertisement
Add Comment
Please, Sign In to add comment